<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<title>Actions Template</title>
<link href="../docs-assets/Breadcrumbs.css" rel="stylesheet" rev="stylesheet" type="text/css">
		<meta name="viewport" content="width=device-width initial-scale=1">
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<meta http-equiv="Content-Language" content="en-gb">

<link href="../docs-assets/Contents.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Progress.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Navigation.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Fonts.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Base.css" rel="stylesheet" rev="stylesheet" type="text/css">
<script>
MathJax = {
	tex: {
		inlineMath: '$', '$'], ['\\(', '\\)'
	},
	svg: {
		fontCache: 'global'
	}
};
</script>
<script type="text/javascript" id="MathJax-script" async
	src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-svg.js">
</script>

<link href="../docs-assets/Colours.css" rel="stylesheet" rev="stylesheet" type="text/css">
		
	</head>
	<body class="commentary-font">
		<nav role="navigation">
		<h1><a href="../index.html"><img src="../docs-assets/Inform.png" height=72> </a></h1>
<ul><li><a href="../index.html">home</a></li>
</ul><h2>Compiler</h2><ul>
<li><a href="../structure.html">structure</a></li>
<li><a href="../inbuildn.html">inbuild</a></li>
<li><a href="../inform7n.html">inform7</a></li>
<li><a href="../intern.html">inter</a></li>
<li><a href="../services.html">services</a></li>
<li><a href="../secrets.html">secrets</a></li>
</ul><h2>Other Tools</h2><ul>
<li><a href="../inblorbn.html">inblorb</a></li>
<li><a href="../inform6.html">inform6</a></li>
<li><a href="../inpolicyn.html">inpolicy</a></li>
</ul><h2>Resources</h2><ul>
<li><a href="../extensions.html">extensions</a></li>
<li><a href="../kits.html">kits</a></li>
</ul><h2>Repository</h2><ul>
<li><a href="https://github.com/ganelson/inform"><img src="../docs-assets/github.png" height=0> github</a></li>
</ul><h2>Related Projects</h2><ul>
<li><a href="https://github.com/ganelson/inweb"><img src="../docs-assets/github.png" height=0> inweb</a></li>
<li><a href="https://github.com/ganelson/intest"><img src="../docs-assets/github.png" height=0> intest</a></li>
</ul>
		</nav>
		<main role="main">
		<!-- Weave of 'Actions Template' generated by inweb -->
<div class="breadcrumbs">
    <ul class="crumbs"><li><a href="../index.html">Home</a></li><li><a href="../extensions.html">Kits</a></li><li><a href="index.html">WorldModelKit</a></li><li><b>Actions Template</b></li></ul></div>
<p class="purpose">To try actions by people in the model world, processing the necessary rulebooks.</p>

<ul class="toc"><li><a href="actm.html#SP1">&#167;1. Summary</a></li><li><a href="actm.html#SP2">&#167;2. Fake Actions</a></li><li><a href="actm.html#SP3">&#167;3. Action Data</a></li><li><a href="actm.html#SP4">&#167;4. Requirements Bitmap</a></li><li><a href="actm.html#SP5">&#167;5. Try Action</a></li><li><a href="actm.html#SP6">&#167;6. I6 Angle Brackets</a></li><li><a href="actm.html#SP7">&#167;7. Conversion</a></li><li><a href="actm.html#SP8">&#167;8. Implicit Take</a></li><li><a href="actm.html#SP9">&#167;9. Look After Going</a></li><li><a href="actm.html#SP10">&#167;10. Abbreviated Room Description</a></li><li><a href="actm.html#SP11">&#167;11. Begin Action</a></li><li><a href="actm.html#SP12">&#167;12. Action Primitive</a></li><li><a href="actm.html#SP13">&#167;13. Internal Rule</a></li><li><a href="actm.html#SP14">&#167;14. Type Safety</a></li><li><a href="actm.html#SP15">&#167;15. Basic Visibility Rule</a></li><li><a href="actm.html#SP16">&#167;16. Basic Accessibility Rule</a></li><li><a href="actm.html#SP17">&#167;17. Carrying Requirements Rule</a></li><li><a href="actm.html#SP18">&#167;18. Standard Implicit Taking Rule</a></li><li><a href="actm.html#SP19">&#167;19. Requested Actions Require Persuasion Rule</a></li><li><a href="actm.html#SP20">&#167;20. Carry Out Requested Actions Rule</a></li><li><a href="actm.html#SP21">&#167;21. Generic Verb Subroutine</a></li><li><a href="actm.html#SP22">&#167;22. Descend To Specific Action Rule</a></li><li><a href="actm.html#SP23">&#167;23. Work Out Details Of Specific Action Rule</a></li><li><a href="actm.html#SP24">&#167;24. Actions Bitmap</a></li><li><a href="actm.html#SP25">&#167;25. Printing Actions</a></li></ul><hr class="tocbar">

<p class="commentary firstcommentary"><a id="SP1" class="paragraph-anchor"></a><b>&#167;1. Summary.</b>To review: an action is an impulse to do something by a person in the model
world. Commands such as DROP POTATO are converted into actions ("dropping
the Idaho potato"); sometimes they succeed, sometimes they fail. While
they run, the fairly complicated details are stored in a suite of I6
global variables such as <span class="extract"><span class="extract-syntax">actor</span></span>, <span class="extract"><span class="extract-syntax">noun</span></span>, <span class="extract"><span class="extract-syntax">inp1</span></span>, and so on (see
"OrderOfPlay.i6t" for details); the running of an action is mainly a
matter of processing many rulebooks, chief among them they "action processing
rules".
</p>

<p class="commentary">In general, actions can come from five different sources:
</p>

<ul class="items"><li>(i) As a result of parsing the player's command: there are actually two ways
this can happen, one if the command calls for a single action, and another
if it calls for a whole run of them (like TAKE ALL). See the rules in
"OrderOfPlay.i6t".
</li><li>(ii) From an I7 "try" phrase, in which case <span class="extract"><span class="extract-syntax">TryAction</span></span> is called.
</li><li>(iii) From an I6 angle-bracket-notation such as <span class="extract"><span class="extract-syntax">&lt;Wait&gt;</span></span>, though this is a
syntax which is deprecated now, and is never normally used in I7. The I6
compiler converts such a syntax into a call to the <span class="extract"><span class="extract-syntax">R_Process</span></span> below.
</li><li>(iv) Through conversion of an existing action. For instance, "removing the
cup from the table" is converted in the Standard Rules to "taking the cup".
This is done via a routine called <span class="extract"><span class="extract-syntax">GVS_Convert</span></span>.
</li><li>(v) When a request is successful, the "carry out requested actions" rule
turns the original action &mdash; a request by the player, such as is produced
by CHOPIN, PLAY POLONAISE &mdash; into an action by the person asked, such as
"Chopin playing the Polonaise".
</li></ul>
<p class="commentary">Certain exceptional cases can arise for other reasons:
</p>

<ul class="items"><li>(vi) Implicit taking actions are generated by the "carrying requirements rule"
when the actor tries something which requires him to be holding an item which
he can see, but is not currently holding.
</li><li>(vii) A partial but intentionally incomplete form of the "looking" action is
generated when describing the new location at the end of a "going" action.
</li></ul>
<p class="commentary">In every case except (vii), the action is carried out by <span class="extract"><span class="extract-syntax">BeginAction</span></span>, the
single routine which unifies all of these approaches. Except the last one.
</p>

<p class="commentary">This segment of the template is divided into two: first, the I6 code needed
for (i) to (vii), the alternative ways for actions to begin; and secondly
the common machinery into which all actions eventually pass.
</p>

<p class="commentary firstcommentary"><a id="SP2" class="paragraph-anchor"></a><b>&#167;2. Fake Actions.</b>Though sometimes useful for I6 coding tricks, fake actions &mdash; action numbers
not corresponding to any action, but different from those of valid actions,
and useable with a number of action syntaxes &mdash; are not conceptually present
in I7 source text. They can only really exist at the I6 level because I6 is
typeless; in I7 terms, there is no convenient kind of value which could
represent both actions and fake actions while protecting each from confusion
with the other.
</p>

<p class="commentary">The following fake actions from the I6 library have been dropped here:
<span class="extract"><span class="extract-syntax">##LetGo</span></span>, <span class="extract"><span class="extract-syntax">##Receive</span></span>, <span class="extract"><span class="extract-syntax">##ThrownAt</span></span>, <span class="extract"><span class="extract-syntax">##Prompt</span></span>, <span class="extract"><span class="extract-syntax">##Places</span></span>, <span class="extract"><span class="extract-syntax">##Objects</span></span>,
<span class="extract"><span class="extract-syntax">##Order</span></span>, <span class="extract"><span class="extract-syntax">##NotUnderstood</span></span>.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="identifier-syntax">Fake_Action</span><span class="plain-syntax"> </span><span class="identifier-syntax">ListMiscellany</span><span class="plain-syntax">;</span>
<span class="identifier-syntax">Fake_Action</span><span class="plain-syntax"> </span><span class="identifier-syntax">Miscellany</span><span class="plain-syntax">;</span>
<span class="identifier-syntax">Fake_Action</span><span class="plain-syntax"> </span><span class="identifier-syntax">PluralFound</span><span class="plain-syntax">;</span>
<span class="identifier-syntax">Fake_Action</span><span class="plain-syntax"> </span><span class="identifier-syntax">TheSame</span><span class="plain-syntax">;</span>
</pre>
<p class="commentary firstcommentary"><a id="SP3" class="paragraph-anchor"></a><b>&#167;3. Action Data.</b>This is perhaps a good place to document the <span class="extract"><span class="extract-syntax">ActionData</span></span> array, a convenient
table of metadata about the actions. Since this is compiled by Inform, the
following structure can't be modified here without making matching changes
in Inform. <span class="extract"><span class="extract-syntax">ActionData</span></span> is an I6 <span class="extract"><span class="extract-syntax">table</span></span> containing a series of fixed-length
records, one on each action.
</p>

<p class="commentary">The routine <span class="extract"><span class="extract-syntax">FindAction</span></span> locates the record in this table for a given
action number, returning its word offset within the table: the argument \(-1\)
means "the current action".
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">Constant</span><span class="plain-syntax"> </span><span class="identifier-syntax">AD_ACTION</span><span class="plain-syntax"> = </span><span class="constant-syntax">0</span><span class="plain-syntax">; </span><span class="comment-syntax">The I6 action number (0 to 4095)</span>
<span class="reserved-syntax">Constant</span><span class="plain-syntax"> </span><span class="identifier-syntax">AD_REQUIREMENTS</span><span class="plain-syntax"> = </span><span class="constant-syntax">1</span><span class="plain-syntax">; </span><span class="comment-syntax">Such as requiring light; a bitmap, see below</span>
<span class="reserved-syntax">Constant</span><span class="plain-syntax"> </span><span class="identifier-syntax">AD_NOUN_KOV</span><span class="plain-syntax"> = </span><span class="constant-syntax">2</span><span class="plain-syntax">; </span><span class="comment-syntax">Kind of value of the first noun</span>
<span class="reserved-syntax">Constant</span><span class="plain-syntax"> </span><span class="identifier-syntax">AD_SECOND_KOV</span><span class="plain-syntax"> = </span><span class="constant-syntax">3</span><span class="plain-syntax">; </span><span class="comment-syntax">Kind of value of the second noun</span>
<span class="reserved-syntax">Constant</span><span class="plain-syntax"> </span><span class="identifier-syntax">AD_VARIABLES_CREATOR</span><span class="plain-syntax"> = </span><span class="constant-syntax">4</span><span class="plain-syntax">; </span><span class="comment-syntax">Routine to initialise variables owned</span>
<span class="reserved-syntax">Constant</span><span class="plain-syntax"> </span><span class="identifier-syntax">AD_VARIABLES_ID</span><span class="plain-syntax"> = </span><span class="constant-syntax">5</span><span class="plain-syntax">; </span><span class="comment-syntax">Frame ID for variables owned by action</span>

<span class="reserved-syntax">Constant</span><span class="plain-syntax"> </span><span class="identifier-syntax">AD_RECORD_SIZE</span><span class="plain-syntax"> = </span><span class="constant-syntax">6</span><span class="plain-syntax">;</span>

<span class="plain-syntax">[ </span><span class="identifier-syntax">FindAction</span><span class="plain-syntax"> </span><span class="identifier-syntax">fa</span><span class="plain-syntax"> </span><span class="identifier-syntax">t</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">fa</span><span class="plain-syntax"> == -1) </span><span class="identifier-syntax">fa</span><span class="plain-syntax"> = </span><span class="identifier-syntax">action</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">t</span><span class="plain-syntax"> = </span><span class="constant-syntax">1</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">while</span><span class="plain-syntax"> (</span><span class="identifier-syntax">t</span><span class="plain-syntax"> &lt;= </span><span class="identifier-syntax">ActionData</span><span class="plain-syntax">--&gt;0) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">fa</span><span class="plain-syntax"> == </span><span class="identifier-syntax">ActionData</span><span class="plain-syntax">--&gt;</span><span class="identifier-syntax">t</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">t</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">t</span><span class="plain-syntax"> = </span><span class="identifier-syntax">t</span><span class="plain-syntax"> + </span><span class="identifier-syntax">AD_RECORD_SIZE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">rfalse</span><span class="plain-syntax">;</span>
<span class="plain-syntax">];</span>

<span class="plain-syntax">[ </span><span class="identifier-syntax">ActionNumberIndexed</span><span class="plain-syntax"> </span><span class="identifier-syntax">i</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">i</span><span class="plain-syntax">&gt;=0) &amp;&amp; (</span><span class="identifier-syntax">i</span><span class="plain-syntax"> &lt; </span><span class="identifier-syntax">AD_RECORDS</span><span class="plain-syntax">)) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">ActionData</span><span class="plain-syntax">--&gt;(</span><span class="identifier-syntax">i</span><span class="plain-syntax">*</span><span class="identifier-syntax">AD_RECORD_SIZE</span><span class="plain-syntax"> + </span><span class="identifier-syntax">AD_ACTION</span><span class="plain-syntax"> + </span><span class="constant-syntax">1</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="constant-syntax">0</span><span class="plain-syntax">;</span>
<span class="plain-syntax">];</span>
</pre>
<p class="commentary firstcommentary"><a id="SP4" class="paragraph-anchor"></a><b>&#167;4. Requirements Bitmap.</b>As noted above, the <span class="extract"><span class="extract-syntax">AD_REQUIREMENTS</span></span> field is a bitmap of flags for
various possible action requirements:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">Constant</span><span class="plain-syntax"> </span><span class="identifier-syntax">TOUCH_NOUN_ABIT</span><span class="plain-syntax">   = </span><span class="constant-syntax">$$00000001</span><span class="plain-syntax">;</span>
<span class="reserved-syntax">Constant</span><span class="plain-syntax"> </span><span class="identifier-syntax">TOUCH_SECOND_ABIT</span><span class="plain-syntax"> = </span><span class="constant-syntax">$$00000010</span><span class="plain-syntax">;</span>
<span class="reserved-syntax">Constant</span><span class="plain-syntax"> </span><span class="identifier-syntax">LIGHT_ABIT</span><span class="plain-syntax">        = </span><span class="constant-syntax">$$00000100</span><span class="plain-syntax">;</span>
<span class="reserved-syntax">Constant</span><span class="plain-syntax"> </span><span class="identifier-syntax">NEED_NOUN_ABIT</span><span class="plain-syntax">    = </span><span class="constant-syntax">$$00001000</span><span class="plain-syntax">;</span>
<span class="reserved-syntax">Constant</span><span class="plain-syntax"> </span><span class="identifier-syntax">NEED_SECOND_ABIT</span><span class="plain-syntax">  = </span><span class="constant-syntax">$$00010000</span><span class="plain-syntax">;</span>
<span class="reserved-syntax">Constant</span><span class="plain-syntax"> </span><span class="identifier-syntax">OUT_OF_WORLD_ABIT</span><span class="plain-syntax"> = </span><span class="constant-syntax">$$00100000</span><span class="plain-syntax">;</span>
<span class="reserved-syntax">Constant</span><span class="plain-syntax"> </span><span class="identifier-syntax">CARRY_NOUN_ABIT</span><span class="plain-syntax">   = </span><span class="constant-syntax">$$01000000</span><span class="plain-syntax">;</span>
<span class="reserved-syntax">Constant</span><span class="plain-syntax"> </span><span class="identifier-syntax">CARRY_SECOND_ABIT</span><span class="plain-syntax"> = </span><span class="constant-syntax">$$10000000</span><span class="plain-syntax">;</span>

<span class="plain-syntax">[ </span><span class="identifier-syntax">NeedToCarryNoun</span><span class="plain-syntax">;       </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">TestActionMask</span><span class="plain-syntax">(</span><span class="identifier-syntax">CARRY_NOUN_ABIT</span><span class="plain-syntax">); ];</span>
<span class="plain-syntax">[ </span><span class="identifier-syntax">NeedToCarrySecondNoun</span><span class="plain-syntax">; </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">TestActionMask</span><span class="plain-syntax">(</span><span class="identifier-syntax">CARRY_SECOND_ABIT</span><span class="plain-syntax">); ];</span>
<span class="plain-syntax">[ </span><span class="identifier-syntax">NeedToTouchNoun</span><span class="plain-syntax">;       </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">TestActionMask</span><span class="plain-syntax">(</span><span class="identifier-syntax">TOUCH_NOUN_ABIT</span><span class="plain-syntax">); ];</span>
<span class="plain-syntax">[ </span><span class="identifier-syntax">NeedToTouchSecondNoun</span><span class="plain-syntax">; </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">TestActionMask</span><span class="plain-syntax">(</span><span class="identifier-syntax">TOUCH_SECOND_ABIT</span><span class="plain-syntax">); ];</span>
<span class="plain-syntax">[ </span><span class="identifier-syntax">NeedLightForAction</span><span class="plain-syntax">;    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">TestActionMask</span><span class="plain-syntax">(</span><span class="identifier-syntax">LIGHT_ABIT</span><span class="plain-syntax">); ];</span>

<span class="plain-syntax">[ </span><span class="identifier-syntax">TestActionMask</span><span class="plain-syntax"> </span><span class="identifier-syntax">match</span><span class="plain-syntax"> </span><span class="identifier-syntax">mask</span><span class="plain-syntax"> </span><span class="identifier-syntax">at</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">at</span><span class="plain-syntax"> = </span><span class="identifier-syntax">FindAction</span><span class="plain-syntax">(-1);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">at</span><span class="plain-syntax"> == </span><span class="constant-syntax">0</span><span class="plain-syntax">) </span><span class="reserved-syntax">rfalse</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">mask</span><span class="plain-syntax"> = </span><span class="identifier-syntax">ActionData</span><span class="plain-syntax">--&gt;(</span><span class="identifier-syntax">at</span><span class="plain-syntax">+</span><span class="identifier-syntax">AD_REQUIREMENTS</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">mask</span><span class="plain-syntax"> &amp; </span><span class="identifier-syntax">match</span><span class="plain-syntax">) </span><span class="reserved-syntax">rtrue</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">rfalse</span><span class="plain-syntax">;</span>
<span class="plain-syntax">];</span>
</pre>
<p class="commentary firstcommentary"><a id="SP5" class="paragraph-anchor"></a><b>&#167;5. Try Action.</b>This is method (ii) in the summary above.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">[ </span><span class="identifier-syntax">TryAction</span><span class="plain-syntax"> </span><span class="identifier-syntax">req</span><span class="plain-syntax"> </span><span class="identifier-syntax">by</span><span class="plain-syntax"> </span><span class="identifier-syntax">ac</span><span class="plain-syntax"> </span><span class="identifier-syntax">n</span><span class="plain-syntax"> </span><span class="identifier-syntax">s</span><span class="plain-syntax"> </span><span class="identifier-syntax">stora</span><span class="plain-syntax"> </span><span class="identifier-syntax">smeta</span><span class="plain-syntax"> </span><span class="identifier-syntax">tbits</span><span class="plain-syntax"> </span><span class="identifier-syntax">saved_command</span><span class="plain-syntax"> </span><span class="identifier-syntax">text_of_command</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">stora</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">STORED_ACTION_TY_New</span><span class="plain-syntax">(</span><span class="identifier-syntax">ac</span><span class="plain-syntax">, </span><span class="identifier-syntax">n</span><span class="plain-syntax">, </span><span class="identifier-syntax">s</span><span class="plain-syntax">, </span><span class="identifier-syntax">by</span><span class="plain-syntax">, </span><span class="identifier-syntax">req</span><span class="plain-syntax">, </span><span class="identifier-syntax">stora</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">tbits</span><span class="plain-syntax"> = </span><span class="identifier-syntax">req</span><span class="plain-syntax"> &amp; (16+32);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">req</span><span class="plain-syntax"> = </span><span class="identifier-syntax">req</span><span class="plain-syntax"> &amp; </span><span class="constant-syntax">1</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    @</span><span class="identifier-syntax">push</span><span class="plain-syntax"> </span><span class="identifier-syntax">actor</span><span class="plain-syntax">; @</span><span class="identifier-syntax">push</span><span class="plain-syntax"> </span><span class="identifier-syntax">act_requester</span><span class="plain-syntax">; @</span><span class="identifier-syntax">push</span><span class="plain-syntax"> </span><span class="identifier-syntax">inp1</span><span class="plain-syntax">; @</span><span class="identifier-syntax">push</span><span class="plain-syntax"> </span><span class="identifier-syntax">inp2</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    @</span><span class="identifier-syntax">push</span><span class="plain-syntax"> </span><span class="identifier-syntax">parsed_number</span><span class="plain-syntax">; </span><span class="identifier-syntax">smeta</span><span class="plain-syntax"> = </span><span class="identifier-syntax">meta</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">by</span><span class="plain-syntax"> == </span><span class="constant-syntax">0</span><span class="plain-syntax">) </span><span class="identifier-syntax">by</span><span class="plain-syntax"> = </span><span class="identifier-syntax">player</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">actor</span><span class="plain-syntax"> = </span><span class="identifier-syntax">by</span><span class="plain-syntax">; </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">req</span><span class="plain-syntax">) </span><span class="identifier-syntax">act_requester</span><span class="plain-syntax"> = </span><span class="identifier-syntax">player</span><span class="plain-syntax">; </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="identifier-syntax">act_requester</span><span class="plain-syntax"> = </span><span class="constant-syntax">0</span><span class="plain-syntax">;</span>

<span class="plain-syntax">    </span><span class="identifier-syntax">by</span><span class="plain-syntax"> = </span><span class="identifier-syntax">FindAction</span><span class="plain-syntax">(</span><span class="identifier-syntax">ac</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">by</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">ActionData</span><span class="plain-syntax">--&gt;(</span><span class="identifier-syntax">by</span><span class="plain-syntax">+</span><span class="identifier-syntax">AD_NOUN_KOV</span><span class="plain-syntax">) == </span><span class="identifier-syntax">OBJECT_TY</span><span class="plain-syntax">) </span><span class="identifier-syntax">inp1</span><span class="plain-syntax"> = </span><span class="identifier-syntax">n</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">else</span><span class="plain-syntax"> { </span><span class="identifier-syntax">inp1</span><span class="plain-syntax"> = </span><span class="constant-syntax">1</span><span class="plain-syntax">; </span><span class="identifier-syntax">parsed_number</span><span class="plain-syntax"> = </span><span class="identifier-syntax">n</span><span class="plain-syntax">; }</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">ActionData</span><span class="plain-syntax">--&gt;(</span><span class="identifier-syntax">by</span><span class="plain-syntax">+</span><span class="identifier-syntax">AD_SECOND_KOV</span><span class="plain-syntax">) == </span><span class="identifier-syntax">OBJECT_TY</span><span class="plain-syntax">) </span><span class="identifier-syntax">inp2</span><span class="plain-syntax"> = </span><span class="identifier-syntax">s</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">else</span><span class="plain-syntax"> { </span><span class="identifier-syntax">inp2</span><span class="plain-syntax"> = </span><span class="constant-syntax">1</span><span class="plain-syntax">; </span><span class="identifier-syntax">parsed_number</span><span class="plain-syntax"> = </span><span class="identifier-syntax">s</span><span class="plain-syntax">; }</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (((</span><span class="identifier-syntax">ActionData</span><span class="plain-syntax">--&gt;(</span><span class="identifier-syntax">by</span><span class="plain-syntax">+</span><span class="identifier-syntax">AD_NOUN_KOV</span><span class="plain-syntax">) == </span><span class="identifier-syntax">UNDERSTANDING_TY</span><span class="plain-syntax">) ||</span>
<span class="plain-syntax">            (</span><span class="identifier-syntax">ActionData</span><span class="plain-syntax">--&gt;(</span><span class="identifier-syntax">by</span><span class="plain-syntax">+</span><span class="identifier-syntax">AD_SECOND_KOV</span><span class="plain-syntax">) == </span><span class="identifier-syntax">UNDERSTANDING_TY</span><span class="plain-syntax">)) &amp;&amp; (</span><span class="identifier-syntax">tbits</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">saved_command</span><span class="plain-syntax"> = </span><span class="identifier-syntax">CreatePV</span><span class="plain-syntax">(</span><span class="identifier-syntax">TEXT_TY</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">SNIPPET_TY_to_TEXT_TY</span><span class="plain-syntax">(</span><span class="identifier-syntax">saved_command</span><span class="plain-syntax">, </span><span class="identifier-syntax">players_command</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">text_of_command</span><span class="plain-syntax"> = </span><span class="identifier-syntax">CreatePV</span><span class="plain-syntax">(</span><span class="identifier-syntax">TEXT_TY</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">CopyPV</span><span class="plain-syntax">(</span><span class="identifier-syntax">text_of_command</span><span class="plain-syntax">, </span><span class="identifier-syntax">parsed_number</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">SetPlayersCommand</span><span class="plain-syntax">(</span><span class="identifier-syntax">text_of_command</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">tbits</span><span class="plain-syntax"> == </span><span class="constant-syntax">16</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">n</span><span class="plain-syntax"> = </span><span class="identifier-syntax">players_command</span><span class="plain-syntax">; </span><span class="identifier-syntax">inp1</span><span class="plain-syntax"> = </span><span class="constant-syntax">1</span><span class="plain-syntax">; </span><span class="identifier-syntax">parsed_number</span><span class="plain-syntax"> = </span><span class="identifier-syntax">players_command</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">s</span><span class="plain-syntax"> = </span><span class="identifier-syntax">players_command</span><span class="plain-syntax">; </span><span class="identifier-syntax">inp2</span><span class="plain-syntax"> = </span><span class="constant-syntax">1</span><span class="plain-syntax">; </span><span class="identifier-syntax">parsed_number</span><span class="plain-syntax"> = </span><span class="identifier-syntax">players_command</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            }</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">DestroyPV</span><span class="plain-syntax">(</span><span class="identifier-syntax">text_of_command</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            @</span><span class="identifier-syntax">push</span><span class="plain-syntax"> </span><span class="identifier-syntax">consult_from</span><span class="plain-syntax">; @</span><span class="identifier-syntax">push</span><span class="plain-syntax"> </span><span class="identifier-syntax">consult_words</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">consult_from</span><span class="plain-syntax"> = </span><span class="constant-syntax">1</span><span class="plain-syntax">; </span><span class="identifier-syntax">consult_words</span><span class="plain-syntax"> = </span><span class="identifier-syntax">parsed_number</span><span class="plain-syntax"> - </span><span class="constant-syntax">100</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">    }</span>

<span class="plain-syntax">    </span><span class="identifier-syntax">BeginAction</span><span class="plain-syntax">(</span><span class="identifier-syntax">ac</span><span class="plain-syntax">, </span><span class="identifier-syntax">n</span><span class="plain-syntax">, </span><span class="identifier-syntax">s</span><span class="plain-syntax">, </span><span class="constant-syntax">0</span><span class="plain-syntax">, </span><span class="reserved-syntax">true</span><span class="plain-syntax">);</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">saved_command</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        @</span><span class="identifier-syntax">pull</span><span class="plain-syntax"> </span><span class="identifier-syntax">consult_words</span><span class="plain-syntax">; @</span><span class="identifier-syntax">pull</span><span class="plain-syntax"> </span><span class="identifier-syntax">consult_from</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">SetPlayersCommand</span><span class="plain-syntax">(</span><span class="identifier-syntax">saved_command</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">DestroyPV</span><span class="plain-syntax">(</span><span class="identifier-syntax">saved_command</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    }</span>

<span class="plain-syntax">    </span><span class="identifier-syntax">meta</span><span class="plain-syntax"> = </span><span class="identifier-syntax">smeta</span><span class="plain-syntax">; @</span><span class="identifier-syntax">pull</span><span class="plain-syntax"> </span><span class="identifier-syntax">parsed_number</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    @</span><span class="identifier-syntax">pull</span><span class="plain-syntax"> </span><span class="identifier-syntax">inp2</span><span class="plain-syntax">; @</span><span class="identifier-syntax">pull</span><span class="plain-syntax"> </span><span class="identifier-syntax">inp1</span><span class="plain-syntax">; @</span><span class="identifier-syntax">pull</span><span class="plain-syntax"> </span><span class="identifier-syntax">act_requester</span><span class="plain-syntax">; @</span><span class="identifier-syntax">pull</span><span class="plain-syntax"> </span><span class="identifier-syntax">actor</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">TrackActions</span><span class="plain-syntax">(</span><span class="reserved-syntax">true</span><span class="plain-syntax">, </span><span class="identifier-syntax">smeta</span><span class="plain-syntax">);</span>
<span class="plain-syntax">];</span>
</pre>
<p class="commentary firstcommentary"><a id="SP6" class="paragraph-anchor"></a><b>&#167;6. I6 Angle Brackets.</b>This is method (iii) in the summary above. The routine here has slightly
odd conventions and a curious name which would take too long to explain:
neither can be changed without amending the veneer code within the I6
compiler.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">[ </span><span class="identifier-syntax">R_Process</span><span class="plain-syntax"> </span><span class="identifier-syntax">a</span><span class="plain-syntax"> </span><span class="identifier-syntax">i</span><span class="plain-syntax"> </span><span class="identifier-syntax">j</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    @</span><span class="identifier-syntax">push</span><span class="plain-syntax"> </span><span class="identifier-syntax">inp1</span><span class="plain-syntax">; @</span><span class="identifier-syntax">push</span><span class="plain-syntax"> </span><span class="identifier-syntax">inp2</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inp1</span><span class="plain-syntax"> = </span><span class="identifier-syntax">i</span><span class="plain-syntax">; </span><span class="identifier-syntax">inp2</span><span class="plain-syntax"> = </span><span class="identifier-syntax">j</span><span class="plain-syntax">; </span><span class="identifier-syntax">BeginAction</span><span class="plain-syntax">(</span><span class="identifier-syntax">a</span><span class="plain-syntax">, </span><span class="identifier-syntax">i</span><span class="plain-syntax">, </span><span class="identifier-syntax">j</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    @</span><span class="identifier-syntax">pull</span><span class="plain-syntax"> </span><span class="identifier-syntax">inp2</span><span class="plain-syntax">; @</span><span class="identifier-syntax">pull</span><span class="plain-syntax"> </span><span class="identifier-syntax">inp1</span><span class="plain-syntax">;</span>
<span class="plain-syntax">];</span>
</pre>
<p class="commentary firstcommentary"><a id="SP7" class="paragraph-anchor"></a><b>&#167;7. Conversion.</b>This is method (iv) in the summary above.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="identifier-syntax">Global</span><span class="plain-syntax"> </span><span class="identifier-syntax">converted_action_outcome</span><span class="plain-syntax"> = -1;</span>
<span class="plain-syntax">[ </span><span class="identifier-syntax">GVS_Convert</span><span class="plain-syntax"> </span><span class="identifier-syntax">ac</span><span class="plain-syntax"> </span><span class="identifier-syntax">n</span><span class="plain-syntax"> </span><span class="identifier-syntax">s</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">converted_action_outcome</span><span class="plain-syntax"> = </span><span class="identifier-syntax">BeginAction</span><span class="plain-syntax">(</span><span class="identifier-syntax">ac</span><span class="plain-syntax">, </span><span class="identifier-syntax">n</span><span class="plain-syntax">, </span><span class="identifier-syntax">s</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">converted_action_outcome</span><span class="plain-syntax"> == </span><span class="reserved-syntax">true</span><span class="plain-syntax">) </span><span class="identifier-syntax">FollowRulebook</span><span class="plain-syntax">(</span><span class="identifier-syntax">AFTER_RB</span><span class="plain-syntax">, </span><span class="reserved-syntax">nothing</span><span class="plain-syntax">, </span><span class="reserved-syntax">true</span><span class="plain-syntax"> );</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">rtrue</span><span class="plain-syntax">;</span>
<span class="plain-syntax">];</span>

<span class="plain-syntax">[ </span><span class="identifier-syntax">ConvertToRequest</span><span class="plain-syntax"> </span><span class="identifier-syntax">X</span><span class="plain-syntax"> </span><span class="identifier-syntax">AN</span><span class="plain-syntax"> </span><span class="identifier-syntax">Y</span><span class="plain-syntax"> </span><span class="identifier-syntax">Z</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">WORK_OUT_DETAILS_OF_SPECIFIC_R</span><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">X</span><span class="plain-syntax"> == </span><span class="identifier-syntax">player</span><span class="plain-syntax">) </span><span class="identifier-syntax">TryAction</span><span class="plain-syntax">(</span><span class="reserved-syntax">false</span><span class="plain-syntax">, </span><span class="identifier-syntax">X</span><span class="plain-syntax">, </span><span class="identifier-syntax">AN</span><span class="plain-syntax">, </span><span class="identifier-syntax">Y</span><span class="plain-syntax">, </span><span class="identifier-syntax">Z</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="identifier-syntax">TryAction</span><span class="plain-syntax">(</span><span class="reserved-syntax">true</span><span class="plain-syntax">, </span><span class="identifier-syntax">X</span><span class="plain-syntax">, </span><span class="identifier-syntax">AN</span><span class="plain-syntax">, </span><span class="identifier-syntax">Y</span><span class="plain-syntax">, </span><span class="identifier-syntax">Z</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">rtrue</span><span class="plain-syntax">;</span>
<span class="plain-syntax">];</span>

<span class="plain-syntax">[ </span><span class="identifier-syntax">ConvertToGoingWithPush</span><span class="plain-syntax"> </span><span class="identifier-syntax">i</span><span class="plain-syntax"> </span><span class="identifier-syntax">oldrm</span><span class="plain-syntax"> </span><span class="identifier-syntax">newrm</span><span class="plain-syntax"> </span><span class="identifier-syntax">infl</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">i</span><span class="plain-syntax">=</span><span class="identifier-syntax">noun</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">IndirectlyContains</span><span class="plain-syntax">(</span><span class="identifier-syntax">noun</span><span class="plain-syntax">, </span><span class="identifier-syntax">actor</span><span class="plain-syntax">) == </span><span class="reserved-syntax">false</span><span class="plain-syntax">) { </span><span class="reserved-syntax">move</span><span class="plain-syntax"> </span><span class="identifier-syntax">i</span><span class="plain-syntax"> </span><span class="reserved-syntax">to</span><span class="plain-syntax"> </span><span class="identifier-syntax">actor</span><span class="plain-syntax">; </span><span class="identifier-syntax">infl</span><span class="plain-syntax"> = </span><span class="reserved-syntax">true</span><span class="plain-syntax">; }</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">move_pushing</span><span class="plain-syntax"> = </span><span class="identifier-syntax">i</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">oldrm</span><span class="plain-syntax"> = </span><span class="identifier-syntax">LocationOf</span><span class="plain-syntax">(</span><span class="identifier-syntax">noun</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">BeginAction</span><span class="plain-syntax">(##</span><span class="identifier-syntax">Go</span><span class="plain-syntax">, </span><span class="identifier-syntax">second</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">newrm</span><span class="plain-syntax"> = </span><span class="identifier-syntax">LocationOf</span><span class="plain-syntax">(</span><span class="identifier-syntax">actor</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">move_pushing</span><span class="plain-syntax"> = </span><span class="reserved-syntax">nothing</span><span class="plain-syntax">; </span><span class="reserved-syntax">move</span><span class="plain-syntax"> </span><span class="identifier-syntax">i</span><span class="plain-syntax"> </span><span class="reserved-syntax">to</span><span class="plain-syntax"> </span><span class="identifier-syntax">newrm</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">newrm</span><span class="plain-syntax"> ~= </span><span class="identifier-syntax">oldrm</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">IndirectlyContains</span><span class="plain-syntax">(</span><span class="identifier-syntax">i</span><span class="plain-syntax">, </span><span class="identifier-syntax">player</span><span class="plain-syntax">)) </span><span class="identifier-syntax">TryAction</span><span class="plain-syntax">(0, </span><span class="identifier-syntax">player</span><span class="plain-syntax">, ##</span><span class="identifier-syntax">Look</span><span class="plain-syntax">, </span><span class="constant-syntax">0</span><span class="plain-syntax">, </span><span class="constant-syntax">0</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">RulebookSucceeds</span><span class="plain-syntax">();</span>
<span class="plain-syntax">    } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="identifier-syntax">RulebookFails</span><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">rtrue</span><span class="plain-syntax">;</span>
<span class="plain-syntax">];</span>
</pre>
<p class="commentary firstcommentary"><a id="SP8" class="paragraph-anchor"></a><b>&#167;8. Implicit Take.</b>This is method (vi) in the summary above.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">[ </span><span class="identifier-syntax">ImplicitTake</span><span class="plain-syntax"> </span><span class="identifier-syntax">obj</span><span class="plain-syntax"> </span><span class="identifier-syntax">ks</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">actor</span><span class="plain-syntax"> == </span><span class="identifier-syntax">player</span><span class="plain-syntax">) { </span><span class="identifier-syntax">STANDARD_IMPLICIT_TAKING_RM</span><span class="plain-syntax">(</span><span class="character-syntax">'A'</span><span class="plain-syntax">, </span><span class="identifier-syntax">obj</span><span class="plain-syntax">); }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">TestVisibility</span><span class="plain-syntax">(</span><span class="identifier-syntax">player</span><span class="plain-syntax">, </span><span class="identifier-syntax">actor</span><span class="plain-syntax">))</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">STANDARD_IMPLICIT_TAKING_RM</span><span class="plain-syntax">(</span><span class="character-syntax">'B'</span><span class="plain-syntax">, </span><span class="identifier-syntax">obj</span><span class="plain-syntax">, </span><span class="identifier-syntax">actor</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">ClearParagraphing</span><span class="plain-syntax">(3);</span>
<span class="plain-syntax">    @</span><span class="identifier-syntax">push</span><span class="plain-syntax"> </span><span class="identifier-syntax">keep_silent</span><span class="plain-syntax">; </span><span class="identifier-syntax">keep_silent</span><span class="plain-syntax"> = </span><span class="reserved-syntax">true</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    @</span><span class="identifier-syntax">push</span><span class="plain-syntax"> </span><span class="identifier-syntax">say__p</span><span class="plain-syntax">; @</span><span class="identifier-syntax">push</span><span class="plain-syntax"> </span><span class="identifier-syntax">say__pc</span><span class="plain-syntax">; </span><span class="identifier-syntax">ClearParagraphing</span><span class="plain-syntax">(4);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">act_requester</span><span class="plain-syntax">) </span><span class="identifier-syntax">TryAction</span><span class="plain-syntax">(</span><span class="reserved-syntax">true</span><span class="plain-syntax">, </span><span class="identifier-syntax">actor</span><span class="plain-syntax">, ##</span><span class="identifier-syntax">Take</span><span class="plain-syntax">, </span><span class="identifier-syntax">obj</span><span class="plain-syntax">, </span><span class="reserved-syntax">nothing</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="identifier-syntax">TryAction</span><span class="plain-syntax">(</span><span class="reserved-syntax">false</span><span class="plain-syntax">, </span><span class="identifier-syntax">actor</span><span class="plain-syntax">, ##</span><span class="identifier-syntax">Take</span><span class="plain-syntax">, </span><span class="identifier-syntax">obj</span><span class="plain-syntax">, </span><span class="reserved-syntax">nothing</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">DivideParagraphPoint</span><span class="plain-syntax">(); @</span><span class="identifier-syntax">pull</span><span class="plain-syntax"> </span><span class="identifier-syntax">say__pc</span><span class="plain-syntax">; @</span><span class="identifier-syntax">pull</span><span class="plain-syntax"> </span><span class="identifier-syntax">say__p</span><span class="plain-syntax">; </span><span class="identifier-syntax">AdjustParagraphPoint</span><span class="plain-syntax">(); @</span><span class="identifier-syntax">pull</span><span class="plain-syntax"> </span><span class="identifier-syntax">keep_silent</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">obj</span><span class="plain-syntax"> </span><span class="reserved-syntax">in</span><span class="plain-syntax"> </span><span class="identifier-syntax">actor</span><span class="plain-syntax">) </span><span class="reserved-syntax">rtrue</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">rfalse</span><span class="plain-syntax">;</span>
<span class="plain-syntax">];</span>
</pre>
<p class="commentary firstcommentary"><a id="SP9" class="paragraph-anchor"></a><b>&#167;9. Look After Going.</b>This is method (vii) in the summary above.
</p>

<p class="commentary">Fundamentally, room descriptions arise through looking actions, but they
are also printed after successful going actions, with a special form of
paragraph break (see "Printing.i6t" for an explanation of this). Room
descriptions through looking are always given in full, unless we have
SUPERBRIEF mode set.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">[ </span><span class="identifier-syntax">LookAfterGoing</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">GoingLookBreak</span><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">AbbreviatedRoomDescription</span><span class="plain-syntax">();</span>
<span class="plain-syntax">];</span>
</pre>
<p class="commentary firstcommentary"><a id="SP10" class="paragraph-anchor"></a><b>&#167;10. Abbreviated Room Description.</b>This is used when we want a room description with the same abbreviation
conventions as after a going action, and we don't quite want a looking
action fully to take place. We nevertheless want to be sure that the
action variables for looking exist, and in particular, we want to set the
"room-describing action" variable to the action which was prevailing
when the room description was called for. We also set "abbreviated form
allowed" to "true": when the ordinary looking action is running, this
is "false".
</p>

<p class="commentary">The actual description occurs during <span class="extract"><span class="extract-syntax">LookSub</span></span>, which is the specific
action processing stage for the "looking" action: thus, we use the
check, carry out, after and report rules as if we were "looking", but
are unaffected by before or instead rules.
</p>

<p class="commentary">Uniquely, this pseudo-action does not use <span class="extract"><span class="extract-syntax">BeginAction</span></span>: it works only
through the specific action processing rules, not the main action-processing
ones, though that is not easy to see from the code below because it is
hidden in the call to <span class="extract"><span class="extract-syntax">LookSub</span></span>. The <span class="extract"><span class="extract-syntax">-Sub</span></span> suffix is an I6 usage identifying
this as the routine to go along with the action <span class="extract"><span class="extract-syntax">##Look</span></span>, and so it is,
but it looks nothing like the <span class="extract"><span class="extract-syntax">LookSub</span></span> of the old I6 library. Inform compiles
<span class="extract"><span class="extract-syntax">-Sub</span></span> routines like so:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    [ </span><span class="identifier-syntax">LookSub</span><span class="plain-syntax">; </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">GenericVerbSub</span><span class="plain-syntax">(153,154,155); ];</span>
</pre>
<p class="commentary">(with whatever rulebook numbers are appropriate). <span class="extract"><span class="extract-syntax">GenericVerbSub</span></span> then
runs through the specific action processing stage.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">[ </span><span class="identifier-syntax">AbbreviatedRoomDescription</span><span class="plain-syntax">  </span><span class="identifier-syntax">prior_action</span><span class="plain-syntax"> </span><span class="identifier-syntax">pos</span><span class="plain-syntax"> </span><span class="identifier-syntax">frame_id</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">prior_action</span><span class="plain-syntax"> = </span><span class="identifier-syntax">action</span><span class="plain-syntax">;</span>

<span class="plain-syntax">    </span><span class="identifier-syntax">action</span><span class="plain-syntax"> = ##</span><span class="identifier-syntax">Look</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">pos</span><span class="plain-syntax"> = </span><span class="identifier-syntax">FindAction</span><span class="plain-syntax">(##</span><span class="identifier-syntax">Look</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">pos</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">ActionData</span><span class="plain-syntax">--&gt;(</span><span class="identifier-syntax">pos</span><span class="plain-syntax">+</span><span class="identifier-syntax">AD_VARIABLES_CREATOR</span><span class="plain-syntax">))) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">frame_id</span><span class="plain-syntax"> = </span><span class="identifier-syntax">ActionData</span><span class="plain-syntax">--&gt;(</span><span class="identifier-syntax">pos</span><span class="plain-syntax">+</span><span class="identifier-syntax">AD_VARIABLES_ID</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Mstack_Create_Frame</span><span class="plain-syntax">(</span><span class="identifier-syntax">ActionData</span><span class="plain-syntax">--&gt;(</span><span class="identifier-syntax">pos</span><span class="plain-syntax">+</span><span class="identifier-syntax">AD_VARIABLES_CREATOR</span><span class="plain-syntax">), </span><span class="identifier-syntax">frame_id</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">FollowRulebook</span><span class="plain-syntax">(</span><span class="identifier-syntax">SETTING_ACTION_VARIABLES_RB</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        (</span><span class="identifier-syntax">MStack</span><span class="plain-syntax">--&gt;</span><span class="identifier-syntax">MstVO</span><span class="plain-syntax">(</span><span class="identifier-syntax">frame_id</span><span class="plain-syntax">, </span><span class="constant-syntax">0</span><span class="plain-syntax">)) = </span><span class="identifier-syntax">prior_action</span><span class="plain-syntax">; </span><span class="comment-syntax">"room-describing action"</span>
<span class="plain-syntax">        (</span><span class="identifier-syntax">MStack</span><span class="plain-syntax">--&gt;</span><span class="identifier-syntax">MstVO</span><span class="plain-syntax">(</span><span class="identifier-syntax">frame_id</span><span class="plain-syntax">, </span><span class="constant-syntax">1</span><span class="plain-syntax">)) = </span><span class="reserved-syntax">true</span><span class="plain-syntax">; </span><span class="comment-syntax">"abbreviated form allowed"</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">LookSub</span><span class="plain-syntax">(); </span><span class="comment-syntax">The I6 verb routine for "looking"</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">frame_id</span><span class="plain-syntax">) </span><span class="identifier-syntax">Mstack_Destroy_Frame</span><span class="plain-syntax">(</span><span class="identifier-syntax">ActionData</span><span class="plain-syntax">--&gt;(</span><span class="identifier-syntax">pos</span><span class="plain-syntax">+</span><span class="identifier-syntax">AD_VARIABLES_CREATOR</span><span class="plain-syntax">), </span><span class="identifier-syntax">frame_id</span><span class="plain-syntax">);</span>

<span class="plain-syntax">    </span><span class="identifier-syntax">action</span><span class="plain-syntax"> = </span><span class="identifier-syntax">prior_action</span><span class="plain-syntax">;</span>
<span class="plain-syntax">];</span>
</pre>
<p class="commentary firstcommentary"><a id="SP11" class="paragraph-anchor"></a><b>&#167;11. Begin Action.</b>We now begin the second half of the segment: the machinery which handles
all actions.
</p>

<p class="commentary">The significance of 4096 here is that this is how I6 distinguishes genuine
actions &mdash; numbered upwards in order of creation &mdash; from what I6 calls
"fake actions" &mdash; numbered upwards from 4096. Fake actions are hardly
used at all in I7, and certainly shouldn't get here, but it's possible
nonetheless using I6 angled-brackets, so... In other respects all we do
is to save details of whatever current action is happening onto the stack,
and then call <span class="extract"><span class="extract-syntax">ActionPrimitive</span></span>.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">[ </span><span class="identifier-syntax">BeginAction</span><span class="plain-syntax"> </span><span class="identifier-syntax">a</span><span class="plain-syntax"> </span><span class="identifier-syntax">n</span><span class="plain-syntax"> </span><span class="identifier-syntax">s</span><span class="plain-syntax"> </span><span class="identifier-syntax">moi</span><span class="plain-syntax"> </span><span class="identifier-syntax">notrack</span><span class="plain-syntax">  </span><span class="identifier-syntax">rv</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">ChronologyPoint</span><span class="plain-syntax">();</span>

<span class="plain-syntax">    @</span><span class="identifier-syntax">push</span><span class="plain-syntax"> </span><span class="identifier-syntax">action</span><span class="plain-syntax">; @</span><span class="identifier-syntax">push</span><span class="plain-syntax"> </span><span class="identifier-syntax">noun</span><span class="plain-syntax">; @</span><span class="identifier-syntax">push</span><span class="plain-syntax"> </span><span class="identifier-syntax">second</span><span class="plain-syntax">; @</span><span class="identifier-syntax">push</span><span class="plain-syntax"> </span><span class="identifier-syntax">self</span><span class="plain-syntax">; @</span><span class="identifier-syntax">push</span><span class="plain-syntax"> </span><span class="identifier-syntax">multiple_object_item</span><span class="plain-syntax">;</span>

<span class="plain-syntax">    </span><span class="identifier-syntax">action</span><span class="plain-syntax"> = </span><span class="identifier-syntax">a</span><span class="plain-syntax">; </span><span class="identifier-syntax">noun</span><span class="plain-syntax"> = </span><span class="identifier-syntax">n</span><span class="plain-syntax">; </span><span class="identifier-syntax">second</span><span class="plain-syntax"> = </span><span class="identifier-syntax">s</span><span class="plain-syntax">; </span><span class="identifier-syntax">self</span><span class="plain-syntax"> = </span><span class="identifier-syntax">noun</span><span class="plain-syntax">; </span><span class="identifier-syntax">multiple_object_item</span><span class="plain-syntax"> = </span><span class="identifier-syntax">moi</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">action</span><span class="plain-syntax"> &lt; </span><span class="constant-syntax">4096</span><span class="plain-syntax">) </span><span class="identifier-syntax">rv</span><span class="plain-syntax"> = </span><span class="identifier-syntax">ActionPrimitive</span><span class="plain-syntax">();</span>

<span class="plain-syntax">    @</span><span class="identifier-syntax">pull</span><span class="plain-syntax"> </span><span class="identifier-syntax">multiple_object_item</span><span class="plain-syntax">; @</span><span class="identifier-syntax">pull</span><span class="plain-syntax"> </span><span class="identifier-syntax">self</span><span class="plain-syntax">; @</span><span class="identifier-syntax">pull</span><span class="plain-syntax"> </span><span class="identifier-syntax">second</span><span class="plain-syntax">; @</span><span class="identifier-syntax">pull</span><span class="plain-syntax"> </span><span class="identifier-syntax">noun</span><span class="plain-syntax">; @</span><span class="identifier-syntax">pull</span><span class="plain-syntax"> </span><span class="identifier-syntax">action</span><span class="plain-syntax">;</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">notrack</span><span class="plain-syntax"> == </span><span class="reserved-syntax">false</span><span class="plain-syntax">) </span><span class="identifier-syntax">TrackActions</span><span class="plain-syntax">(</span><span class="reserved-syntax">true</span><span class="plain-syntax">, </span><span class="identifier-syntax">meta</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">AfterActionHook</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">meta</span><span class="plain-syntax"> == </span><span class="reserved-syntax">false</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">rv</span><span class="plain-syntax">) &amp;&amp; (</span><span class="reserved-syntax">indirect</span><span class="plain-syntax">(</span><span class="identifier-syntax">AfterActionHook</span><span class="plain-syntax">))) </span><span class="reserved-syntax">rtrue</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">rv</span><span class="plain-syntax">;</span>
<span class="plain-syntax">];</span>
</pre>
<p class="commentary firstcommentary"><a id="SP12" class="paragraph-anchor"></a><b>&#167;12. Action Primitive.</b>This is somewhat different from the I6 library counterpart which gives it
its name, but the idea is the same. It has no arguments at all: everything
it needs to know is now stored in global variables. The routine looks long,
but really contains little: it's all just book-keeping, printing debugging
information if ACTIONS is in force, etc., with all of the actual work
delegated to the action processing rulebook.
</p>

<p class="commentary">We use a rather sneaky device to handle out-of-world actions, those for
which the <span class="extract"><span class="extract-syntax">meta</span></span> flag is set: we make it look to the system as if the
"action processing rulebook" is being followed, so that all its variables
are created and placed in scope, but at the crucial moment we descend to
the specific action processing rules directly instead of processing the
main rulebook. This is what short-circuits out of world actions and
protects them from before and instead rules: see the Standard Rules for
more discussion of this.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">[ </span><span class="identifier-syntax">ActionPrimitive</span><span class="plain-syntax"> </span><span class="identifier-syntax">rv</span><span class="plain-syntax"> </span><span class="identifier-syntax">p1</span><span class="plain-syntax"> </span><span class="identifier-syntax">p2</span><span class="plain-syntax"> </span><span class="identifier-syntax">p3</span><span class="plain-syntax"> </span><span class="identifier-syntax">p4</span><span class="plain-syntax"> </span><span class="identifier-syntax">p5</span><span class="plain-syntax"> </span><span class="identifier-syntax">frame_id</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">MStack_CreateRBVars</span><span class="plain-syntax">(</span><span class="identifier-syntax">ACTION_PROCESSING_RB</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">keep_silent</span><span class="plain-syntax"> == </span><span class="reserved-syntax">false</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">multiflag</span><span class="plain-syntax"> == </span><span class="reserved-syntax">false</span><span class="plain-syntax">)) </span><span class="identifier-syntax">DivideParagraphPoint</span><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">reason_the_action_failed</span><span class="plain-syntax"> = </span><span class="constant-syntax">0</span><span class="plain-syntax">;</span>

<span class="plain-syntax">    </span><span class="identifier-syntax">frame_id</span><span class="plain-syntax"> = -1;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">p1</span><span class="plain-syntax"> = </span><span class="identifier-syntax">FindAction</span><span class="plain-syntax">(</span><span class="identifier-syntax">action</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">p1</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">ActionData</span><span class="plain-syntax">--&gt;(</span><span class="identifier-syntax">p1</span><span class="plain-syntax">+</span><span class="identifier-syntax">AD_VARIABLES_CREATOR</span><span class="plain-syntax">))) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">frame_id</span><span class="plain-syntax"> = </span><span class="identifier-syntax">ActionData</span><span class="plain-syntax">--&gt;(</span><span class="identifier-syntax">p1</span><span class="plain-syntax">+</span><span class="identifier-syntax">AD_VARIABLES_ID</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Mstack_Create_Frame</span><span class="plain-syntax">(</span><span class="identifier-syntax">ActionData</span><span class="plain-syntax">--&gt;(</span><span class="identifier-syntax">p1</span><span class="plain-syntax">+</span><span class="identifier-syntax">AD_VARIABLES_CREATOR</span><span class="plain-syntax">), </span><span class="identifier-syntax">frame_id</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">ActionVariablesNotTypeSafe</span><span class="plain-syntax">()) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">actor</span><span class="plain-syntax"> ~= </span><span class="identifier-syntax">player</span><span class="plain-syntax">) { </span><span class="identifier-syntax">ACTION_PROCESSING_INTERNAL_RM</span><span class="plain-syntax">(</span><span class="character-syntax">'K'</span><span class="plain-syntax">); </span><span class="reserved-syntax">new_line</span><span class="plain-syntax">; }</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">frame_id</span><span class="plain-syntax"> ~= -1)</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">Mstack_Destroy_Frame</span><span class="plain-syntax">(</span><span class="identifier-syntax">ActionData</span><span class="plain-syntax">--&gt;(</span><span class="identifier-syntax">p1</span><span class="plain-syntax">+</span><span class="identifier-syntax">AD_VARIABLES_CREATOR</span><span class="plain-syntax">), </span><span class="identifier-syntax">frame_id</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">MStack_DestroyRBVars</span><span class="plain-syntax">(</span><span class="identifier-syntax">ACTION_PROCESSING_RB</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>

<span class="plain-syntax">    </span><span class="identifier-syntax">FollowRulebook</span><span class="plain-syntax">(</span><span class="identifier-syntax">SETTING_ACTION_VARIABLES_RB</span><span class="plain-syntax">);</span>

<span class="plain-syntax">    #</span><span class="identifier-syntax">IFDEF</span><span class="plain-syntax"> </span><span class="identifier-syntax">DEBUG</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">trace_actions</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">FindAction</span><span class="plain-syntax">(-1)) &amp;&amp; (</span><span class="identifier-syntax">action</span><span class="plain-syntax"> ~= ##</span><span class="identifier-syntax">ActionsOn</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">action</span><span class="plain-syntax"> ~= ##</span><span class="identifier-syntax">ActionsOff</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">print</span><span class="plain-syntax"> </span><span class="string-syntax">"["</span><span class="plain-syntax">; </span><span class="identifier-syntax">p1</span><span class="plain-syntax">=</span><span class="identifier-syntax">actor</span><span class="plain-syntax">; </span><span class="identifier-syntax">p2</span><span class="plain-syntax">=</span><span class="identifier-syntax">act_requester</span><span class="plain-syntax">; </span><span class="identifier-syntax">p3</span><span class="plain-syntax">=</span><span class="identifier-syntax">action</span><span class="plain-syntax">; </span><span class="identifier-syntax">p4</span><span class="plain-syntax">=</span><span class="identifier-syntax">noun</span><span class="plain-syntax">; </span><span class="identifier-syntax">p5</span><span class="plain-syntax">=</span><span class="identifier-syntax">second</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">DB_Action</span><span class="plain-syntax">(</span><span class="identifier-syntax">p1</span><span class="plain-syntax">,</span><span class="identifier-syntax">p2</span><span class="plain-syntax">,</span><span class="identifier-syntax">p3</span><span class="plain-syntax">,</span><span class="identifier-syntax">p4</span><span class="plain-syntax">,</span><span class="identifier-syntax">p5</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">print</span><span class="plain-syntax"> </span><span class="string-syntax">"]^"</span><span class="plain-syntax">; </span><span class="identifier-syntax">ClearParagraphing</span><span class="plain-syntax">(5);</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    ++</span><span class="identifier-syntax">debug_rule_nesting</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    #</span><span class="identifier-syntax">ENDIF</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">TrackActions</span><span class="plain-syntax">(</span><span class="reserved-syntax">false</span><span class="plain-syntax">, </span><span class="identifier-syntax">meta</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">meta</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">actor</span><span class="plain-syntax"> ~= </span><span class="identifier-syntax">player</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">ACTION_PROCESSING_INTERNAL_RM</span><span class="plain-syntax">(</span><span class="character-syntax">'A'</span><span class="plain-syntax">, </span><span class="identifier-syntax">actor</span><span class="plain-syntax">); </span><span class="reserved-syntax">new_line</span><span class="plain-syntax">; </span><span class="identifier-syntax">rv</span><span class="plain-syntax"> = </span><span class="identifier-syntax">RS_FAILS</span><span class="plain-syntax">; }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">meta</span><span class="plain-syntax">) { </span><span class="identifier-syntax">DESCEND_TO_SPECIFIC_ACTION_R</span><span class="plain-syntax">(); </span><span class="identifier-syntax">rv</span><span class="plain-syntax"> = </span><span class="identifier-syntax">RulebookOutcome</span><span class="plain-syntax">(); }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">else</span><span class="plain-syntax"> { </span><span class="identifier-syntax">FollowRulebook</span><span class="plain-syntax">(</span><span class="identifier-syntax">ACTION_PROCESSING_RB</span><span class="plain-syntax">); </span><span class="identifier-syntax">rv</span><span class="plain-syntax"> = </span><span class="identifier-syntax">RulebookOutcome</span><span class="plain-syntax">(); }</span>
<span class="plain-syntax">    #</span><span class="identifier-syntax">IFDEF</span><span class="plain-syntax"> </span><span class="identifier-syntax">DEBUG</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    --</span><span class="identifier-syntax">debug_rule_nesting</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">trace_actions</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">FindAction</span><span class="plain-syntax">(-1)) &amp;&amp; (</span><span class="identifier-syntax">action</span><span class="plain-syntax"> ~= ##</span><span class="identifier-syntax">ActionsOn</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">action</span><span class="plain-syntax"> ~= ##</span><span class="identifier-syntax">ActionsOff</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">print</span><span class="plain-syntax"> </span><span class="string-syntax">"["</span><span class="plain-syntax">; </span><span class="identifier-syntax">DB_Action</span><span class="plain-syntax">(</span><span class="identifier-syntax">p1</span><span class="plain-syntax">,</span><span class="identifier-syntax">p2</span><span class="plain-syntax">,</span><span class="identifier-syntax">p3</span><span class="plain-syntax">,</span><span class="identifier-syntax">p4</span><span class="plain-syntax">,</span><span class="identifier-syntax">p5</span><span class="plain-syntax">); </span><span class="reserved-syntax">print</span><span class="plain-syntax"> </span><span class="string-syntax">" - "</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">switch</span><span class="plain-syntax"> (</span><span class="identifier-syntax">rv</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">RS_SUCCEEDS</span><span class="plain-syntax">: </span><span class="reserved-syntax">print</span><span class="plain-syntax"> </span><span class="string-syntax">"succeeded"</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">RS_FAILS</span><span class="plain-syntax">: </span><span class="reserved-syntax">print</span><span class="plain-syntax"> </span><span class="string-syntax">"failed"</span><span class="plain-syntax">;</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">reason_the_action_failed</span><span class="plain-syntax">)</span>
<span class="plain-syntax">                    </span><span class="reserved-syntax">print</span><span class="plain-syntax"> </span><span class="string-syntax">" the "</span><span class="plain-syntax">,</span>
<span class="plain-syntax">                        (</span><span class="identifier-syntax">RulePrintingRule</span><span class="plain-syntax">) </span><span class="identifier-syntax">reason_the_action_failed</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">default</span><span class="plain-syntax">: </span><span class="reserved-syntax">print</span><span class="plain-syntax"> </span><span class="string-syntax">"ended without result"</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">print</span><span class="plain-syntax"> </span><span class="string-syntax">"]^"</span><span class="plain-syntax">; </span><span class="identifier-syntax">say__p</span><span class="plain-syntax"> = </span><span class="constant-syntax">1</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">SetRulebookOutcome</span><span class="plain-syntax">(</span><span class="identifier-syntax">rv</span><span class="plain-syntax">); </span><span class="comment-syntax">In case disturbed by printing activities</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    #</span><span class="identifier-syntax">ENDIF</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">rv</span><span class="plain-syntax"> == </span><span class="identifier-syntax">RS_SUCCEEDS</span><span class="plain-syntax">) </span><span class="identifier-syntax">UpdateActionBitmap</span><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">frame_id</span><span class="plain-syntax"> ~= -1) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">p1</span><span class="plain-syntax"> = </span><span class="identifier-syntax">FindAction</span><span class="plain-syntax">(</span><span class="identifier-syntax">action</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Mstack_Destroy_Frame</span><span class="plain-syntax">(</span><span class="identifier-syntax">ActionData</span><span class="plain-syntax">--&gt;(</span><span class="identifier-syntax">p1</span><span class="plain-syntax">+</span><span class="identifier-syntax">AD_VARIABLES_CREATOR</span><span class="plain-syntax">), </span><span class="identifier-syntax">frame_id</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">MStack_DestroyRBVars</span><span class="plain-syntax">(</span><span class="identifier-syntax">ACTION_PROCESSING_RB</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">keep_silent</span><span class="plain-syntax"> == </span><span class="reserved-syntax">false</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">multiflag</span><span class="plain-syntax"> == </span><span class="reserved-syntax">false</span><span class="plain-syntax">)) </span><span class="identifier-syntax">DivideParagraphPoint</span><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">rv</span><span class="plain-syntax"> == </span><span class="identifier-syntax">RS_SUCCEEDS</span><span class="plain-syntax">) </span><span class="reserved-syntax">rtrue</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">rfalse</span><span class="plain-syntax">;</span>
<span class="plain-syntax">];</span>
</pre>
<p class="commentary firstcommentary"><a id="SP13" class="paragraph-anchor"></a><b>&#167;13. Internal Rule.</b>Provided only as a hook on which to hang responses.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">[ </span><span class="identifier-syntax">ACTION_PROCESSING_INTERNAL_R</span><span class="plain-syntax">; ];</span>
</pre>
<p class="commentary firstcommentary"><a id="SP14" class="paragraph-anchor"></a><b>&#167;14. Type Safety.</b>Some basic action requirements have to be met before we can go any further:
if they aren't, then it isn't type-safe even to run the action processing
rulebook.
</p>

<ul class="items"><li>(i) For an out of world action, we set the <span class="extract"><span class="extract-syntax">meta</span></span> flag. Otherwise:
</li><li>(ii) If either the noun or second noun is a topic, then this is an action
arising from parsing (such actions do not arise through the "try" phrase,
unless by stored actions in which case this has all happened before and
doesn't need to be done again) &mdash; the parser places details of which words
make up the topic in the I6 global variables <span class="extract"><span class="extract-syntax">consult_words</span></span> and <span class="extract"><span class="extract-syntax">consult_from</span></span>.
We convert them to a valid I7 snippet value.
</li><li>(iii) If either the first or second noun is supposed to be an object but
seems here to be a value, or vice versa, we stop with a parser error. (This
should be fairly difficult to provoke: Inform's type-checking will make it
difficult to arrange without I6 subterfuges.)
</li><li>(iv) If either the first or second noun is supposed to be an object and
required to exist, yet is missing, we use the "supplying a missing noun"
or "supplying a missing second noun" activities to fill the void.
</li></ul>
<p class="commentary">We return <span class="extract"><span class="extract-syntax">true</span></span> if type safety is violated, <span class="extract"><span class="extract-syntax">false</span></span> if all is well.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">[ </span><span class="identifier-syntax">ActionVariablesNotTypeSafe</span><span class="plain-syntax"> </span><span class="identifier-syntax">mask</span><span class="plain-syntax"> </span><span class="identifier-syntax">noun_kova</span><span class="plain-syntax"> </span><span class="identifier-syntax">second_kova</span><span class="plain-syntax"> </span><span class="identifier-syntax">at</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">at</span><span class="plain-syntax"> = </span><span class="identifier-syntax">FindAction</span><span class="plain-syntax">(-1); </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">at</span><span class="plain-syntax"> == </span><span class="constant-syntax">0</span><span class="plain-syntax">) </span><span class="reserved-syntax">rfalse</span><span class="plain-syntax">; </span><span class="comment-syntax">For any I6-defined actions</span>

<span class="plain-syntax">    </span><span class="identifier-syntax">noun_kova</span><span class="plain-syntax"> = </span><span class="identifier-syntax">ActionData</span><span class="plain-syntax">--&gt;(</span><span class="identifier-syntax">at</span><span class="plain-syntax">+</span><span class="identifier-syntax">AD_NOUN_KOV</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">second_kova</span><span class="plain-syntax"> = </span><span class="identifier-syntax">ActionData</span><span class="plain-syntax">--&gt;(</span><span class="identifier-syntax">at</span><span class="plain-syntax">+</span><span class="identifier-syntax">AD_SECOND_KOV</span><span class="plain-syntax">);</span>

<span class="plain-syntax">    </span><span class="comment-syntax">rint "at = ", at, " nst = ", noun_kova, "^";</span>
<span class="plain-syntax">    </span><span class="comment-syntax">rint "consult_from = ", consult_from, " consult_words = ", consult_from, "^";</span>
<span class="plain-syntax">    </span><span class="comment-syntax">rint "inp1 = ", inp1, " noun = ", noun, "^";</span>
<span class="plain-syntax">    </span><span class="comment-syntax">rint "inp2 = ", inp2, " second = ", second, "^";</span>
<span class="plain-syntax">    </span><span class="comment-syntax">rint "sst = ", second_kova, "^";</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">noun_kova</span><span class="plain-syntax"> == </span><span class="identifier-syntax">SNIPPET_TY</span><span class="plain-syntax"> </span><span class="reserved-syntax">or</span><span class="plain-syntax"> </span><span class="identifier-syntax">UNDERSTANDING_TY</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">inp1</span><span class="plain-syntax"> ~= </span><span class="constant-syntax">1</span><span class="plain-syntax">) { </span><span class="identifier-syntax">inp2</span><span class="plain-syntax"> = </span><span class="identifier-syntax">inp1</span><span class="plain-syntax">; </span><span class="identifier-syntax">second</span><span class="plain-syntax"> = </span><span class="identifier-syntax">noun</span><span class="plain-syntax">; }</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">parsed_number</span><span class="plain-syntax"> = </span><span class="constant-syntax">100</span><span class="plain-syntax">*</span><span class="identifier-syntax">consult_from</span><span class="plain-syntax"> + </span><span class="identifier-syntax">consult_words</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">inp1</span><span class="plain-syntax"> = </span><span class="constant-syntax">1</span><span class="plain-syntax">; </span><span class="identifier-syntax">noun</span><span class="plain-syntax"> = </span><span class="reserved-syntax">nothing</span><span class="plain-syntax">; </span><span class="comment-syntax">noun = parsed_number;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">second_kova</span><span class="plain-syntax"> == </span><span class="identifier-syntax">SNIPPET_TY</span><span class="plain-syntax"> </span><span class="reserved-syntax">or</span><span class="plain-syntax"> </span><span class="identifier-syntax">UNDERSTANDING_TY</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">parsed_number</span><span class="plain-syntax"> = </span><span class="constant-syntax">100</span><span class="plain-syntax">*</span><span class="identifier-syntax">consult_from</span><span class="plain-syntax"> + </span><span class="identifier-syntax">consult_words</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">inp2</span><span class="plain-syntax"> = </span><span class="constant-syntax">1</span><span class="plain-syntax">; </span><span class="identifier-syntax">second</span><span class="plain-syntax"> = </span><span class="reserved-syntax">nothing</span><span class="plain-syntax">; </span><span class="comment-syntax">second = parsed_number;</span>
<span class="plain-syntax">    }</span>

<span class="plain-syntax">    </span><span class="identifier-syntax">mask</span><span class="plain-syntax"> = </span><span class="identifier-syntax">ActionData</span><span class="plain-syntax">--&gt;(</span><span class="identifier-syntax">at</span><span class="plain-syntax">+</span><span class="identifier-syntax">AD_REQUIREMENTS</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">mask</span><span class="plain-syntax"> &amp; </span><span class="identifier-syntax">OUT_OF_WORLD_ABIT</span><span class="plain-syntax">) { </span><span class="identifier-syntax">meta</span><span class="plain-syntax"> = </span><span class="constant-syntax">1</span><span class="plain-syntax">; </span><span class="reserved-syntax">rfalse</span><span class="plain-syntax">; }</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">meta</span><span class="plain-syntax"> = </span><span class="constant-syntax">0</span><span class="plain-syntax">;</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">inp1</span><span class="plain-syntax"> == </span><span class="constant-syntax">1</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">noun_kova</span><span class="plain-syntax"> == </span><span class="identifier-syntax">OBJECT_TY</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">actor</span><span class="plain-syntax"> == </span><span class="identifier-syntax">player</span><span class="plain-syntax">) { </span><span class="identifier-syntax">ACTION_PROCESSING_INTERNAL_RM</span><span class="plain-syntax">(</span><span class="character-syntax">'B'</span><span class="plain-syntax">); </span><span class="reserved-syntax">new_line</span><span class="plain-syntax">; }</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">rtrue</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">    } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">noun_kova</span><span class="plain-syntax"> ~= </span><span class="identifier-syntax">OBJECT_TY</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">actor</span><span class="plain-syntax"> == </span><span class="identifier-syntax">player</span><span class="plain-syntax">) { </span><span class="identifier-syntax">ACTION_PROCESSING_INTERNAL_RM</span><span class="plain-syntax">(</span><span class="character-syntax">'C'</span><span class="plain-syntax">); </span><span class="reserved-syntax">new_line</span><span class="plain-syntax">; }</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">rtrue</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">mask</span><span class="plain-syntax"> &amp; </span><span class="identifier-syntax">NEED_NOUN_ABIT</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">noun</span><span class="plain-syntax"> == </span><span class="reserved-syntax">nothing</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">            @</span><span class="identifier-syntax">push</span><span class="plain-syntax"> </span><span class="identifier-syntax">act_requester</span><span class="plain-syntax">; </span><span class="identifier-syntax">act_requester</span><span class="plain-syntax"> = </span><span class="reserved-syntax">nothing</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">CarryOutActivity</span><span class="plain-syntax">(</span><span class="identifier-syntax">SUPPLYING_A_MISSING_NOUN_ACT</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            @</span><span class="identifier-syntax">pull</span><span class="plain-syntax"> </span><span class="identifier-syntax">act_requester</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">noun</span><span class="plain-syntax"> == </span><span class="reserved-syntax">nothing</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">say__p</span><span class="plain-syntax">) </span><span class="reserved-syntax">rtrue</span><span class="plain-syntax">;</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">actor</span><span class="plain-syntax"> == </span><span class="identifier-syntax">player</span><span class="plain-syntax">) { </span><span class="identifier-syntax">ACTION_PROCESSING_INTERNAL_RM</span><span class="plain-syntax">(</span><span class="character-syntax">'D'</span><span class="plain-syntax">); </span><span class="reserved-syntax">new_line</span><span class="plain-syntax">; }</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">rtrue</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            }</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (((</span><span class="identifier-syntax">mask</span><span class="plain-syntax"> &amp; </span><span class="identifier-syntax">NEED_NOUN_ABIT</span><span class="plain-syntax">) == </span><span class="constant-syntax">0</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">noun</span><span class="plain-syntax"> ~= </span><span class="reserved-syntax">nothing</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">actor</span><span class="plain-syntax"> == </span><span class="identifier-syntax">player</span><span class="plain-syntax">) { </span><span class="identifier-syntax">ACTION_PROCESSING_INTERNAL_RM</span><span class="plain-syntax">(</span><span class="character-syntax">'E'</span><span class="plain-syntax">); </span><span class="reserved-syntax">new_line</span><span class="plain-syntax">; }</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">rtrue</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">    }</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">inp2</span><span class="plain-syntax"> == </span><span class="constant-syntax">1</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">second_kova</span><span class="plain-syntax"> == </span><span class="identifier-syntax">OBJECT_TY</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">actor</span><span class="plain-syntax"> == </span><span class="identifier-syntax">player</span><span class="plain-syntax">) { </span><span class="identifier-syntax">ACTION_PROCESSING_INTERNAL_RM</span><span class="plain-syntax">(</span><span class="character-syntax">'F'</span><span class="plain-syntax">); </span><span class="reserved-syntax">new_line</span><span class="plain-syntax">; }</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">rtrue</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">    } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">second_kova</span><span class="plain-syntax"> ~= </span><span class="identifier-syntax">OBJECT_TY</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">actor</span><span class="plain-syntax"> == </span><span class="identifier-syntax">player</span><span class="plain-syntax">) { </span><span class="identifier-syntax">ACTION_PROCESSING_INTERNAL_RM</span><span class="plain-syntax">(</span><span class="character-syntax">'G'</span><span class="plain-syntax">); </span><span class="reserved-syntax">new_line</span><span class="plain-syntax">; }</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">rtrue</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">mask</span><span class="plain-syntax"> &amp; </span><span class="identifier-syntax">NEED_SECOND_ABIT</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">second</span><span class="plain-syntax"> == </span><span class="reserved-syntax">nothing</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">            @</span><span class="identifier-syntax">push</span><span class="plain-syntax"> </span><span class="identifier-syntax">act_requester</span><span class="plain-syntax">; </span><span class="identifier-syntax">act_requester</span><span class="plain-syntax"> = </span><span class="reserved-syntax">nothing</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">CarryOutActivity</span><span class="plain-syntax">(</span><span class="identifier-syntax">SUPPLYING_A_MISSING_SECOND_ACT</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            @</span><span class="identifier-syntax">pull</span><span class="plain-syntax"> </span><span class="identifier-syntax">act_requester</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">second</span><span class="plain-syntax"> == </span><span class="reserved-syntax">nothing</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">say__p</span><span class="plain-syntax">) </span><span class="reserved-syntax">rtrue</span><span class="plain-syntax">;</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">actor</span><span class="plain-syntax"> == </span><span class="identifier-syntax">player</span><span class="plain-syntax">) { </span><span class="identifier-syntax">ACTION_PROCESSING_INTERNAL_RM</span><span class="plain-syntax">(</span><span class="character-syntax">'H'</span><span class="plain-syntax">); </span><span class="reserved-syntax">new_line</span><span class="plain-syntax">; }</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">rtrue</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            }</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (((</span><span class="identifier-syntax">mask</span><span class="plain-syntax"> &amp; </span><span class="identifier-syntax">NEED_SECOND_ABIT</span><span class="plain-syntax">) == </span><span class="constant-syntax">0</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">second</span><span class="plain-syntax"> ~= </span><span class="reserved-syntax">nothing</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">actor</span><span class="plain-syntax"> == </span><span class="identifier-syntax">player</span><span class="plain-syntax">) { </span><span class="identifier-syntax">ACTION_PROCESSING_INTERNAL_RM</span><span class="plain-syntax">(</span><span class="character-syntax">'I'</span><span class="plain-syntax">); </span><span class="reserved-syntax">new_line</span><span class="plain-syntax">; }</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">rtrue</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">    }</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">rfalse</span><span class="plain-syntax">;</span>
<span class="plain-syntax">];</span>
</pre>
<p class="commentary firstcommentary"><a id="SP15" class="paragraph-anchor"></a><b>&#167;15. Basic Visibility Rule.</b>This is one of the I6 primitive rules in the action processing rulebook:
see the account in the Standard Rules for details.
</p>

<p class="commentary">Note that this rule only blocks the player from acting in darkness: this is
because light is only reckoned from the player's perspective in any case,
so that it would be unfair to apply the rule to any other person.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">[ </span><span class="identifier-syntax">BASIC_VISIBILITY_R</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">act_requester</span><span class="plain-syntax">) </span><span class="reserved-syntax">rfalse</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">NeedLightForAction</span><span class="plain-syntax">()) &amp;&amp;</span>
<span class="plain-syntax">        (</span><span class="identifier-syntax">actor</span><span class="plain-syntax"> == </span><span class="identifier-syntax">player</span><span class="plain-syntax">) &amp;&amp;</span>
<span class="plain-syntax">        (</span><span class="identifier-syntax">FollowRulebook</span><span class="plain-syntax">(</span><span class="identifier-syntax">VISIBLE_RB</span><span class="plain-syntax">)) &amp;&amp;</span>
<span class="plain-syntax">        (</span><span class="identifier-syntax">RulebookSucceeded</span><span class="plain-syntax">())) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">BeginActivity</span><span class="plain-syntax">(</span><span class="identifier-syntax">REFUSAL_TO_ACT_IN_DARK_ACT</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">ForActivity</span><span class="plain-syntax">(</span><span class="identifier-syntax">REFUSAL_TO_ACT_IN_DARK_ACT</span><span class="plain-syntax">)==</span><span class="reserved-syntax">false</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">BASIC_VISIBILITY_RM</span><span class="plain-syntax">(</span><span class="character-syntax">'A'</span><span class="plain-syntax">); </span><span class="reserved-syntax">new_line</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">EndActivity</span><span class="plain-syntax">(</span><span class="identifier-syntax">REFUSAL_TO_ACT_IN_DARK_ACT</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">reason_the_action_failed</span><span class="plain-syntax"> = </span><span class="identifier-syntax">BASIC_VISIBILITY_R</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">RulebookFails</span><span class="plain-syntax">();</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">rtrue</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">rfalse</span><span class="plain-syntax">;</span>
<span class="plain-syntax">];</span>
</pre>
<p class="commentary firstcommentary"><a id="SP16" class="paragraph-anchor"></a><b>&#167;16. Basic Accessibility Rule.</b>This is one of the I6 primitive rules in the action processing rulebook:
see the account in the Standard Rules for details.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">[ </span><span class="identifier-syntax">BASIC_ACCESSIBILITY_R</span><span class="plain-syntax"> </span><span class="identifier-syntax">mask</span><span class="plain-syntax"> </span><span class="identifier-syntax">at</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">act_requester</span><span class="plain-syntax">) </span><span class="reserved-syntax">rfalse</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">at</span><span class="plain-syntax"> = </span><span class="identifier-syntax">FindAction</span><span class="plain-syntax">(-1);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">at</span><span class="plain-syntax"> == </span><span class="constant-syntax">0</span><span class="plain-syntax">) </span><span class="reserved-syntax">rfalse</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">mask</span><span class="plain-syntax"> = </span><span class="identifier-syntax">ActionData</span><span class="plain-syntax">--&gt;(</span><span class="identifier-syntax">at</span><span class="plain-syntax">+</span><span class="identifier-syntax">AD_REQUIREMENTS</span><span class="plain-syntax">);</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">mask</span><span class="plain-syntax"> &amp; </span><span class="identifier-syntax">TOUCH_NOUN_ABIT</span><span class="plain-syntax">) &amp;&amp; </span><span class="identifier-syntax">noun</span><span class="plain-syntax"> &amp;&amp; (</span><span class="identifier-syntax">inp1</span><span class="plain-syntax"> ~= </span><span class="constant-syntax">1</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">noun</span><span class="plain-syntax"> </span><span class="reserved-syntax">ofclass</span><span class="plain-syntax"> </span><span class="identifier-syntax">K3_direction</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">RulebookFails</span><span class="plain-syntax">();</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">reason_the_action_failed</span><span class="plain-syntax"> = </span><span class="identifier-syntax">BASIC_ACCESSIBILITY_R</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">actor</span><span class="plain-syntax">~=</span><span class="identifier-syntax">player</span><span class="plain-syntax">) </span><span class="reserved-syntax">rtrue</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">BASIC_ACCESSIBILITY_RM</span><span class="plain-syntax">(</span><span class="character-syntax">'A'</span><span class="plain-syntax">); </span><span class="reserved-syntax">new_line</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">RulebookFails</span><span class="plain-syntax">();</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">reason_the_action_failed</span><span class="plain-syntax"> = </span><span class="identifier-syntax">BASIC_ACCESSIBILITY_R</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">rtrue</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">ObjectIsUntouchable</span><span class="plain-syntax">(</span><span class="identifier-syntax">noun</span><span class="plain-syntax">, (</span><span class="identifier-syntax">actor</span><span class="plain-syntax">~=</span><span class="identifier-syntax">player</span><span class="plain-syntax">), </span><span class="identifier-syntax">actor</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">RulebookFails</span><span class="plain-syntax">();</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">reason_the_action_failed</span><span class="plain-syntax"> = </span><span class="identifier-syntax">BASIC_ACCESSIBILITY_R</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">rtrue</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">    }</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">mask</span><span class="plain-syntax"> &amp; </span><span class="identifier-syntax">TOUCH_SECOND_ABIT</span><span class="plain-syntax">) &amp;&amp; </span><span class="identifier-syntax">second</span><span class="plain-syntax"> &amp;&amp; (</span><span class="identifier-syntax">inp2</span><span class="plain-syntax"> ~= </span><span class="constant-syntax">1</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">second</span><span class="plain-syntax"> </span><span class="reserved-syntax">ofclass</span><span class="plain-syntax"> </span><span class="identifier-syntax">K3_direction</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">RulebookFails</span><span class="plain-syntax">();</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">reason_the_action_failed</span><span class="plain-syntax"> = </span><span class="identifier-syntax">BASIC_ACCESSIBILITY_R</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">actor</span><span class="plain-syntax">~=</span><span class="identifier-syntax">player</span><span class="plain-syntax">) </span><span class="reserved-syntax">rtrue</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">BASIC_ACCESSIBILITY_RM</span><span class="plain-syntax">(</span><span class="character-syntax">'A'</span><span class="plain-syntax">); </span><span class="reserved-syntax">new_line</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">RulebookFails</span><span class="plain-syntax">();</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">reason_the_action_failed</span><span class="plain-syntax"> = </span><span class="identifier-syntax">BASIC_ACCESSIBILITY_R</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">rtrue</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">ObjectIsUntouchable</span><span class="plain-syntax">(</span><span class="identifier-syntax">second</span><span class="plain-syntax">, (</span><span class="identifier-syntax">actor</span><span class="plain-syntax">~=</span><span class="identifier-syntax">player</span><span class="plain-syntax">), </span><span class="identifier-syntax">actor</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">RulebookFails</span><span class="plain-syntax">();</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">reason_the_action_failed</span><span class="plain-syntax"> = </span><span class="identifier-syntax">BASIC_ACCESSIBILITY_R</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">rtrue</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">rfalse</span><span class="plain-syntax">;</span>
<span class="plain-syntax">];</span>
</pre>
<p class="commentary firstcommentary"><a id="SP17" class="paragraph-anchor"></a><b>&#167;17. Carrying Requirements Rule.</b>This is one of the I6 primitive rules in the action processing rulebook:
see the account in the Standard Rules for details.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">[ </span><span class="identifier-syntax">CARRYING_REQUIREMENTS_R</span><span class="plain-syntax"> </span><span class="identifier-syntax">mask</span><span class="plain-syntax"> </span><span class="identifier-syntax">at</span><span class="plain-syntax">;</span>

<span class="plain-syntax">    </span><span class="identifier-syntax">at</span><span class="plain-syntax"> = </span><span class="identifier-syntax">FindAction</span><span class="plain-syntax">(-1);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">at</span><span class="plain-syntax"> == </span><span class="constant-syntax">0</span><span class="plain-syntax">) </span><span class="reserved-syntax">rfalse</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">mask</span><span class="plain-syntax"> = </span><span class="identifier-syntax">ActionData</span><span class="plain-syntax">--&gt;(</span><span class="identifier-syntax">at</span><span class="plain-syntax">+</span><span class="identifier-syntax">AD_REQUIREMENTS</span><span class="plain-syntax">);</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">mask</span><span class="plain-syntax"> &amp; </span><span class="identifier-syntax">TOUCH_NOUN_ABIT</span><span class="plain-syntax">) &amp;&amp; </span><span class="identifier-syntax">noun</span><span class="plain-syntax"> &amp;&amp; (</span><span class="identifier-syntax">inp1</span><span class="plain-syntax"> ~= </span><span class="constant-syntax">1</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">mask</span><span class="plain-syntax"> &amp; </span><span class="identifier-syntax">CARRY_NOUN_ABIT</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">noun</span><span class="plain-syntax"> </span><span class="reserved-syntax">notin</span><span class="plain-syntax"> </span><span class="identifier-syntax">actor</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">CarryOutActivity</span><span class="plain-syntax">(</span><span class="identifier-syntax">IMPLICITLY_TAKING_ACT</span><span class="plain-syntax">, </span><span class="identifier-syntax">noun</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">noun</span><span class="plain-syntax"> </span><span class="reserved-syntax">notin</span><span class="plain-syntax"> </span><span class="identifier-syntax">actor</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">RulebookFails</span><span class="plain-syntax">();</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">reason_the_action_failed</span><span class="plain-syntax"> = </span><span class="identifier-syntax">CARRYING_REQUIREMENTS_R</span><span class="plain-syntax">;</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">rtrue</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            }</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">    }</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">mask</span><span class="plain-syntax"> &amp; </span><span class="identifier-syntax">TOUCH_SECOND_ABIT</span><span class="plain-syntax">) &amp;&amp; </span><span class="identifier-syntax">second</span><span class="plain-syntax"> &amp;&amp; (</span><span class="identifier-syntax">inp2</span><span class="plain-syntax"> ~= </span><span class="constant-syntax">1</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">mask</span><span class="plain-syntax"> &amp; </span><span class="identifier-syntax">CARRY_SECOND_ABIT</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">second</span><span class="plain-syntax"> </span><span class="reserved-syntax">notin</span><span class="plain-syntax"> </span><span class="identifier-syntax">actor</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">CarryOutActivity</span><span class="plain-syntax">(</span><span class="identifier-syntax">IMPLICITLY_TAKING_ACT</span><span class="plain-syntax">, </span><span class="identifier-syntax">second</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">second</span><span class="plain-syntax"> </span><span class="reserved-syntax">notin</span><span class="plain-syntax"> </span><span class="identifier-syntax">actor</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">RulebookFails</span><span class="plain-syntax">();</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">reason_the_action_failed</span><span class="plain-syntax"> = </span><span class="identifier-syntax">CARRYING_REQUIREMENTS_R</span><span class="plain-syntax">;</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">rtrue</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            }</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">rfalse</span><span class="plain-syntax">;</span>
<span class="plain-syntax">];</span>
</pre>
<p class="commentary firstcommentary"><a id="SP18" class="paragraph-anchor"></a><b>&#167;18. Standard Implicit Taking Rule.</b></p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">[ </span><span class="identifier-syntax">STANDARD_IMPLICIT_TAKING_R</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">ImplicitTake</span><span class="plain-syntax">(</span><span class="identifier-syntax">parameter_value</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">rfalse</span><span class="plain-syntax">;</span>
<span class="plain-syntax">];</span>
</pre>
<p class="commentary firstcommentary"><a id="SP19" class="paragraph-anchor"></a><b>&#167;19. Requested Actions Require Persuasion Rule.</b>This is one of the I6 primitive rules in the action processing rulebook:
see the account in the Standard Rules for details.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">[ </span><span class="identifier-syntax">REQUESTED_ACTIONS_REQUIRE_R</span><span class="plain-syntax"> </span><span class="identifier-syntax">rv</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">actor</span><span class="plain-syntax"> ~= </span><span class="identifier-syntax">player</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">act_requester</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        @</span><span class="identifier-syntax">push</span><span class="plain-syntax"> </span><span class="identifier-syntax">say__p</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">say__p</span><span class="plain-syntax"> = </span><span class="constant-syntax">0</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">rv</span><span class="plain-syntax"> = </span><span class="identifier-syntax">FollowRulebook</span><span class="plain-syntax">(</span><span class="identifier-syntax">PERSUADE_RB</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">RulebookSucceeded</span><span class="plain-syntax">() == </span><span class="reserved-syntax">false</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">deadflag</span><span class="plain-syntax"> == </span><span class="reserved-syntax">false</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">say__p</span><span class="plain-syntax"> == </span><span class="reserved-syntax">false</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">REQUESTED_ACTIONS_REQUIRE_RM</span><span class="plain-syntax">(</span><span class="character-syntax">'A'</span><span class="plain-syntax">, </span><span class="identifier-syntax">actor</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">new_line</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            }</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">ActRulebookFails</span><span class="plain-syntax">(</span><span class="identifier-syntax">rv</span><span class="plain-syntax">); </span><span class="reserved-syntax">rtrue</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">        @</span><span class="identifier-syntax">pull</span><span class="plain-syntax"> </span><span class="identifier-syntax">say__p</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">rfalse</span><span class="plain-syntax">;</span>
<span class="plain-syntax">];</span>
</pre>
<p class="commentary firstcommentary"><a id="SP20" class="paragraph-anchor"></a><b>&#167;20. Carry Out Requested Actions Rule.</b>This is one of the I6 primitive rules in the action processing rulebook:
see the account in the Standard Rules for details.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">[ </span><span class="identifier-syntax">CARRY_OUT_REQUESTED_ACTIONS_R</span><span class="plain-syntax"> </span><span class="identifier-syntax">rv</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">actor</span><span class="plain-syntax"> ~= </span><span class="identifier-syntax">player</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">act_requester</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        @</span><span class="identifier-syntax">push</span><span class="plain-syntax"> </span><span class="identifier-syntax">act_requester</span><span class="plain-syntax">; </span><span class="identifier-syntax">act_requester</span><span class="plain-syntax"> = </span><span class="reserved-syntax">nothing</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">rv</span><span class="plain-syntax"> = </span><span class="identifier-syntax">BeginAction</span><span class="plain-syntax">(</span><span class="identifier-syntax">action</span><span class="plain-syntax">, </span><span class="identifier-syntax">noun</span><span class="plain-syntax">, </span><span class="identifier-syntax">second</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (((</span><span class="identifier-syntax">meta</span><span class="plain-syntax">) || (</span><span class="identifier-syntax">rv</span><span class="plain-syntax"> == </span><span class="reserved-syntax">false</span><span class="plain-syntax">)) &amp;&amp; (</span><span class="identifier-syntax">deadflag</span><span class="plain-syntax"> == </span><span class="reserved-syntax">false</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">FollowRulebook</span><span class="plain-syntax">(</span><span class="identifier-syntax">UNSUCCESSFUL_ATTEMPT_RB</span><span class="plain-syntax">) == </span><span class="reserved-syntax">false</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">CARRY_OUT_REQUESTED_ACTIONS_RM</span><span class="plain-syntax">(</span><span class="character-syntax">'A'</span><span class="plain-syntax">, </span><span class="identifier-syntax">actor</span><span class="plain-syntax">); </span><span class="reserved-syntax">new_line</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            }</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">        @</span><span class="identifier-syntax">pull</span><span class="plain-syntax"> </span><span class="identifier-syntax">act_requester</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">FollowRulebook</span><span class="plain-syntax">(</span><span class="identifier-syntax">AFTER_RB</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">ActRulebookSucceeds</span><span class="plain-syntax">();</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">rtrue</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">rfalse</span><span class="plain-syntax">;</span>
<span class="plain-syntax">];</span>
</pre>
<p class="commentary firstcommentary"><a id="SP21" class="paragraph-anchor"></a><b>&#167;21. Generic Verb Subroutine.</b>In I6, actions are carried out by routines with names like <span class="extract"><span class="extract-syntax">TakeSub</span></span>,
consisting of <span class="extract"><span class="extract-syntax">-Sub</span></span> tacked on to the action name <span class="extract"><span class="extract-syntax">Take</span></span>. <span class="extract"><span class="extract-syntax">Sub</span></span> stands for
"subroutine": this is all a convention going back to Inform 1, which was
in 1993 practically an assembler. In the I6 code generated by I7, every
<span class="extract"><span class="extract-syntax">-Sub</span></span> routine corresponding to an I7 action consists only of a call to
<span class="extract"><span class="extract-syntax">GenericVerbSub</span></span> which specifies the three rulebooks it owns: its check,
carry out and report rulebooks.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">Array</span><span class="plain-syntax"> </span><span class="identifier-syntax">Details_of_Specific_Action</span><span class="plain-syntax">--&gt;5;</span>

<span class="plain-syntax">[ </span><span class="identifier-syntax">GenericVerbSub</span><span class="plain-syntax"> </span><span class="identifier-syntax">ch</span><span class="plain-syntax"> </span><span class="identifier-syntax">co</span><span class="plain-syntax"> </span><span class="identifier-syntax">re</span><span class="plain-syntax"> </span><span class="identifier-syntax">vis</span><span class="plain-syntax"> </span><span class="identifier-syntax">rv</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    @</span><span class="identifier-syntax">push</span><span class="plain-syntax"> </span><span class="identifier-syntax">converted_action_outcome</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">converted_action_outcome</span><span class="plain-syntax"> = -1;</span>

<span class="plain-syntax">    </span><span class="identifier-syntax">Details_of_Specific_Action</span><span class="plain-syntax">--&gt;0 = </span><span class="reserved-syntax">true</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">meta</span><span class="plain-syntax">) </span><span class="identifier-syntax">Details_of_Specific_Action</span><span class="plain-syntax">--&gt;0 = </span><span class="reserved-syntax">false</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Details_of_Specific_Action</span><span class="plain-syntax">--&gt;1 = </span><span class="identifier-syntax">keep_silent</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Details_of_Specific_Action</span><span class="plain-syntax">--&gt;2 = </span><span class="identifier-syntax">ch</span><span class="plain-syntax">; </span><span class="comment-syntax">Check rules for the action</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Details_of_Specific_Action</span><span class="plain-syntax">--&gt;3 = </span><span class="identifier-syntax">co</span><span class="plain-syntax">; </span><span class="comment-syntax">Carry out rules for the action</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Details_of_Specific_Action</span><span class="plain-syntax">--&gt;4 = </span><span class="identifier-syntax">re</span><span class="plain-syntax">; </span><span class="comment-syntax">Report rules for the action</span>

<span class="plain-syntax">    </span><span class="identifier-syntax">FollowRulebook</span><span class="plain-syntax">(</span><span class="identifier-syntax">SPECIFIC_ACTION_PROCESSING_RB</span><span class="plain-syntax">, </span><span class="constant-syntax">0</span><span class="plain-syntax">, </span><span class="reserved-syntax">true</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">RulebookFailed</span><span class="plain-syntax">()) &amp;&amp; (</span><span class="identifier-syntax">converted_action_outcome</span><span class="plain-syntax"> == </span><span class="constant-syntax">1</span><span class="plain-syntax">)) </span><span class="identifier-syntax">ActRulebookSucceeds</span><span class="plain-syntax">();</span>

<span class="plain-syntax">    @</span><span class="identifier-syntax">pull</span><span class="plain-syntax"> </span><span class="identifier-syntax">converted_action_outcome</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">rtrue</span><span class="plain-syntax">;</span>
<span class="plain-syntax">];</span>
</pre>
<p class="commentary firstcommentary"><a id="SP22" class="paragraph-anchor"></a><b>&#167;22. Descend To Specific Action Rule.</b>There are 100 or so actions, typically, and this rule is for efficiency's
sake: rather than perform 100 or so comparisons to see which routine to
call, we indirect through a jump table. The routines called are the <span class="extract"><span class="extract-syntax">-Sub</span></span>
routines: thus, for instance, if <span class="extract"><span class="extract-syntax">action</span></span> is <span class="extract"><span class="extract-syntax">##Wait</span></span> then <span class="extract"><span class="extract-syntax">WaitSub</span></span> is
called. It is essential that this routine not be called for fake actions:
in I7 use this is guaranteed, since fake actions are not allowed into the
action machinery at all.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">[ </span><span class="identifier-syntax">DESCEND_TO_SPECIFIC_ACTION_R</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    ( </span><span class="identifier-syntax">VM_ActionFunction</span><span class="plain-syntax">(</span><span class="identifier-syntax">action</span><span class="plain-syntax">) )();</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">rtrue</span><span class="plain-syntax">;</span>
<span class="plain-syntax">];</span>
</pre>
<p class="commentary firstcommentary"><a id="SP23" class="paragraph-anchor"></a><b>&#167;23. Work Out Details Of Specific Action Rule.</b>This is one of the I6 primitive rules in the specific action processing
rulebook, and it's basically a trick to allow information known to the
<span class="extract"><span class="extract-syntax">GenericVerbSub</span></span> routine to be passed down as rulebook variables for the
specific action-processing rules &mdash; in effect allowing us to pass not
one but five parameters to the rulebook: the out-of-world and silence
flags, plus the three specific rulebooks needed to process the action.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">[ </span><span class="identifier-syntax">WORK_OUT_DETAILS_OF_SPECIFIC_R</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">MStack</span><span class="plain-syntax">--&gt;</span><span class="identifier-syntax">MstVO</span><span class="plain-syntax">(</span><span class="identifier-syntax">SPECIFIC_ACTION_PROCESSING_RB</span><span class="plain-syntax">, </span><span class="constant-syntax">0</span><span class="plain-syntax">) = </span><span class="identifier-syntax">Details_of_Specific_Action</span><span class="plain-syntax">--&gt;0;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">MStack</span><span class="plain-syntax">--&gt;</span><span class="identifier-syntax">MstVO</span><span class="plain-syntax">(</span><span class="identifier-syntax">SPECIFIC_ACTION_PROCESSING_RB</span><span class="plain-syntax">, </span><span class="constant-syntax">1</span><span class="plain-syntax">) = </span><span class="identifier-syntax">Details_of_Specific_Action</span><span class="plain-syntax">--&gt;1;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">MStack</span><span class="plain-syntax">--&gt;</span><span class="identifier-syntax">MstVO</span><span class="plain-syntax">(</span><span class="identifier-syntax">SPECIFIC_ACTION_PROCESSING_RB</span><span class="plain-syntax">, </span><span class="constant-syntax">2</span><span class="plain-syntax">) = </span><span class="identifier-syntax">Details_of_Specific_Action</span><span class="plain-syntax">--&gt;2;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">MStack</span><span class="plain-syntax">--&gt;</span><span class="identifier-syntax">MstVO</span><span class="plain-syntax">(</span><span class="identifier-syntax">SPECIFIC_ACTION_PROCESSING_RB</span><span class="plain-syntax">, </span><span class="constant-syntax">3</span><span class="plain-syntax">) = </span><span class="identifier-syntax">Details_of_Specific_Action</span><span class="plain-syntax">--&gt;3;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">MStack</span><span class="plain-syntax">--&gt;</span><span class="identifier-syntax">MstVO</span><span class="plain-syntax">(</span><span class="identifier-syntax">SPECIFIC_ACTION_PROCESSING_RB</span><span class="plain-syntax">, </span><span class="constant-syntax">4</span><span class="plain-syntax">) = </span><span class="identifier-syntax">Details_of_Specific_Action</span><span class="plain-syntax">--&gt;4;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">rfalse</span><span class="plain-syntax">;</span>
<span class="plain-syntax">];</span>
</pre>
<p class="commentary firstcommentary"><a id="SP24" class="paragraph-anchor"></a><b>&#167;24. Actions Bitmap.</b>This is a fairly large bitmap recording which actions have succeeded thus
far on which nouns. It was to some extent an early attempt at implementing
a past-tense system; I'm not at all sure it was successful, since it is
hindered by certain restrictions &mdash; it only records action/noun combinations,
for instance, and the notion of "success" is a vexed one for actions
anyway. There is a clearly defined meaning, but it doesn't always correspond
to what the user might expect, which is unfortunate.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">Constant</span><span class="plain-syntax"> </span><span class="identifier-syntax">ActionCount</span><span class="plain-syntax"> = </span><span class="identifier-syntax">CCOUNT_ACTION_NAME</span><span class="plain-syntax">;</span>

<span class="plain-syntax">[ </span><span class="identifier-syntax">TestActionBitmap</span><span class="plain-syntax"> </span><span class="identifier-syntax">obj</span><span class="plain-syntax"> </span><span class="identifier-syntax">act</span><span class="plain-syntax"> </span><span class="identifier-syntax">i</span><span class="plain-syntax"> </span><span class="identifier-syntax">j</span><span class="plain-syntax"> </span><span class="identifier-syntax">k</span><span class="plain-syntax"> </span><span class="identifier-syntax">bitmap</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">obj</span><span class="plain-syntax"> == </span><span class="reserved-syntax">nothing</span><span class="plain-syntax">) </span><span class="identifier-syntax">bitmap</span><span class="plain-syntax"> = </span><span class="identifier-syntax">ActionHappened</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (~~(</span><span class="identifier-syntax">obj</span><span class="plain-syntax"> </span><span class="reserved-syntax">provides</span><span class="plain-syntax"> </span><span class="identifier-syntax">action_bitmap</span><span class="plain-syntax">)) </span><span class="reserved-syntax">rfalse</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">bitmap</span><span class="plain-syntax"> = </span><span class="identifier-syntax">obj</span><span class="plain-syntax">.&amp;</span><span class="identifier-syntax">action_bitmap</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">act</span><span class="plain-syntax"> == -1) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> (((</span><span class="identifier-syntax">bitmap</span><span class="plain-syntax">-&gt;0) &amp; </span><span class="constant-syntax">1</span><span class="plain-syntax">) ~= </span><span class="constant-syntax">0</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="identifier-syntax">i</span><span class="plain-syntax">=0, </span><span class="identifier-syntax">k</span><span class="plain-syntax">=2: </span><span class="identifier-syntax">i</span><span class="plain-syntax">&lt;</span><span class="identifier-syntax">ActionCount</span><span class="plain-syntax">: </span><span class="identifier-syntax">i</span><span class="plain-syntax">++) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">act</span><span class="plain-syntax"> == </span><span class="identifier-syntax">ActionCoding</span><span class="plain-syntax">--&gt;</span><span class="identifier-syntax">i</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">return</span><span class="plain-syntax"> (((</span><span class="identifier-syntax">bitmap</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">j</span><span class="plain-syntax">) &amp; </span><span class="identifier-syntax">k</span><span class="plain-syntax">) ~= </span><span class="constant-syntax">0</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">k</span><span class="plain-syntax"> = </span><span class="identifier-syntax">k</span><span class="plain-syntax">*2; </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">k</span><span class="plain-syntax"> == </span><span class="constant-syntax">256</span><span class="plain-syntax">) { </span><span class="identifier-syntax">k</span><span class="plain-syntax"> = </span><span class="constant-syntax">1</span><span class="plain-syntax">; </span><span class="identifier-syntax">j</span><span class="plain-syntax">++; }</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">rfalse</span><span class="plain-syntax">;</span>
<span class="plain-syntax">];</span>

<span class="plain-syntax">[ </span><span class="identifier-syntax">UpdateActionBitmap</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">SetActionBitmap</span><span class="plain-syntax">(</span><span class="identifier-syntax">noun</span><span class="plain-syntax">, </span><span class="identifier-syntax">action</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">action</span><span class="plain-syntax"> == ##</span><span class="identifier-syntax">Go</span><span class="plain-syntax">) </span><span class="identifier-syntax">SetActionBitmap</span><span class="plain-syntax">(</span><span class="identifier-syntax">location</span><span class="plain-syntax">, ##</span><span class="identifier-syntax">Enter</span><span class="plain-syntax">);</span>
<span class="plain-syntax">];</span>

<span class="plain-syntax">[ </span><span class="identifier-syntax">SetActionBitmap</span><span class="plain-syntax"> </span><span class="identifier-syntax">obj</span><span class="plain-syntax"> </span><span class="identifier-syntax">act</span><span class="plain-syntax"> </span><span class="identifier-syntax">i</span><span class="plain-syntax"> </span><span class="identifier-syntax">j</span><span class="plain-syntax"> </span><span class="identifier-syntax">k</span><span class="plain-syntax"> </span><span class="identifier-syntax">bitmap</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="identifier-syntax">i</span><span class="plain-syntax">=0, </span><span class="identifier-syntax">k</span><span class="plain-syntax">=2: </span><span class="identifier-syntax">i</span><span class="plain-syntax">&lt;</span><span class="identifier-syntax">ActionCount</span><span class="plain-syntax">: </span><span class="identifier-syntax">i</span><span class="plain-syntax">++) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">act</span><span class="plain-syntax"> == </span><span class="identifier-syntax">ActionCoding</span><span class="plain-syntax">--&gt;</span><span class="identifier-syntax">i</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">obj</span><span class="plain-syntax"> </span><span class="reserved-syntax">provides</span><span class="plain-syntax"> </span><span class="identifier-syntax">action_bitmap</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">bitmap</span><span class="plain-syntax"> = </span><span class="identifier-syntax">obj</span><span class="plain-syntax">.&amp;</span><span class="identifier-syntax">action_bitmap</span><span class="plain-syntax">;</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">bitmap</span><span class="plain-syntax">-&gt;0 = (</span><span class="identifier-syntax">bitmap</span><span class="plain-syntax">-&gt;0) | </span><span class="constant-syntax">1</span><span class="plain-syntax">;</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">bitmap</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">j</span><span class="plain-syntax"> = (</span><span class="identifier-syntax">bitmap</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">j</span><span class="plain-syntax">) | </span><span class="identifier-syntax">k</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            }</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">ActionHappened</span><span class="plain-syntax">-&gt;0 = (</span><span class="identifier-syntax">ActionHappened</span><span class="plain-syntax">-&gt;0) | </span><span class="constant-syntax">1</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">ActionHappened</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">j</span><span class="plain-syntax"> = (</span><span class="identifier-syntax">ActionHappened</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">j</span><span class="plain-syntax">) | </span><span class="identifier-syntax">k</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">k</span><span class="plain-syntax"> = </span><span class="identifier-syntax">k</span><span class="plain-syntax">*2; </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">k</span><span class="plain-syntax"> == </span><span class="constant-syntax">256</span><span class="plain-syntax">) { </span><span class="identifier-syntax">k</span><span class="plain-syntax"> = </span><span class="constant-syntax">1</span><span class="plain-syntax">; </span><span class="identifier-syntax">j</span><span class="plain-syntax">++; }</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">];</span>
</pre>
<p class="commentary firstcommentary"><a id="SP25" class="paragraph-anchor"></a><b>&#167;25. Printing Actions.</b>This is really for debugging purposes, but also provides us with a way to
print a stored action, for instance, or to print an action name value.
(For instance, printing an action name might result in "taking"; printing
a whole action might produce "Henry taking the grapefruit".)
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">[ </span><span class="identifier-syntax">SayActionName</span><span class="plain-syntax"> </span><span class="identifier-syntax">act</span><span class="plain-syntax">; </span><span class="identifier-syntax">DB_Action</span><span class="plain-syntax">(0, </span><span class="constant-syntax">0</span><span class="plain-syntax">, </span><span class="identifier-syntax">act</span><span class="plain-syntax">, </span><span class="constant-syntax">0</span><span class="plain-syntax">, </span><span class="constant-syntax">0</span><span class="plain-syntax">, </span><span class="constant-syntax">2</span><span class="plain-syntax">); ];</span>

<span class="plain-syntax">[ </span><span class="identifier-syntax">DA_Name</span><span class="plain-syntax"> </span><span class="identifier-syntax">n</span><span class="plain-syntax">; </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">n</span><span class="plain-syntax"> </span><span class="reserved-syntax">ofclass</span><span class="plain-syntax"> </span><span class="identifier-syntax">K3_direction</span><span class="plain-syntax">) </span><span class="reserved-syntax">print</span><span class="plain-syntax"> (</span><span class="identifier-syntax">name</span><span class="plain-syntax">) </span><span class="identifier-syntax">n</span><span class="plain-syntax">; </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">print</span><span class="plain-syntax"> (</span><span class="identifier-syntax">the</span><span class="plain-syntax">) </span><span class="identifier-syntax">n</span><span class="plain-syntax">; ];</span>
<span class="plain-syntax">[ </span><span class="identifier-syntax">UNDERSTANDING_TY_Say</span><span class="plain-syntax"> </span><span class="identifier-syntax">x</span><span class="plain-syntax"> </span><span class="identifier-syntax">a</span><span class="plain-syntax"> </span><span class="identifier-syntax">b</span><span class="plain-syntax"> </span><span class="identifier-syntax">c</span><span class="plain-syntax"> </span><span class="identifier-syntax">d</span><span class="plain-syntax"> </span><span class="identifier-syntax">i</span><span class="plain-syntax"> </span><span class="identifier-syntax">cf</span><span class="plain-syntax"> </span><span class="identifier-syntax">cw</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">cw</span><span class="plain-syntax"> = </span><span class="identifier-syntax">x</span><span class="plain-syntax">%100; </span><span class="identifier-syntax">cf</span><span class="plain-syntax"> = </span><span class="identifier-syntax">x</span><span class="plain-syntax">/100;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">print</span><span class="plain-syntax"> </span><span class="string-syntax">"~"</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="identifier-syntax">a</span><span class="plain-syntax">=</span><span class="identifier-syntax">cf</span><span class="plain-syntax">:</span><span class="identifier-syntax">d</span><span class="plain-syntax">&lt;</span><span class="identifier-syntax">cw</span><span class="plain-syntax">:</span><span class="identifier-syntax">d</span><span class="plain-syntax">++,</span><span class="identifier-syntax">a</span><span class="plain-syntax">++) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">wn</span><span class="plain-syntax"> = </span><span class="identifier-syntax">a</span><span class="plain-syntax">; </span><span class="identifier-syntax">b</span><span class="plain-syntax"> = </span><span class="identifier-syntax">WordAddress</span><span class="plain-syntax">(</span><span class="identifier-syntax">a</span><span class="plain-syntax">); </span><span class="identifier-syntax">c</span><span class="plain-syntax"> = </span><span class="identifier-syntax">WordLength</span><span class="plain-syntax">(</span><span class="identifier-syntax">a</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="identifier-syntax">i</span><span class="plain-syntax">=0:</span><span class="identifier-syntax">i</span><span class="plain-syntax">&lt;</span><span class="identifier-syntax">c</span><span class="plain-syntax">:</span><span class="identifier-syntax">i</span><span class="plain-syntax">++) {</span>
<span class="plain-syntax">            #</span><span class="identifier-syntax">Iftrue</span><span class="plain-syntax"> </span><span class="identifier-syntax">CHARSIZE</span><span class="plain-syntax"> == </span><span class="constant-syntax">1</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">print</span><span class="plain-syntax"> (</span><span class="identifier-syntax">char</span><span class="plain-syntax">) </span><span class="identifier-syntax">b</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">i</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            #</span><span class="identifier-syntax">Ifnot</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">print</span><span class="plain-syntax"> (</span><span class="identifier-syntax">char</span><span class="plain-syntax">) </span><span class="identifier-syntax">b</span><span class="plain-syntax">--&gt;</span><span class="identifier-syntax">i</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            #</span><span class="identifier-syntax">Endif</span><span class="plain-syntax">; </span><span class="comment-syntax">CHARSIZE</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">d</span><span class="plain-syntax">&lt;</span><span class="identifier-syntax">cw</span><span class="plain-syntax">-1) </span><span class="reserved-syntax">print</span><span class="plain-syntax"> </span><span class="string-syntax">" "</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">print</span><span class="plain-syntax"> </span><span class="string-syntax">"~"</span><span class="plain-syntax">;</span>
<span class="plain-syntax">];</span>
<span class="plain-syntax">[ </span><span class="identifier-syntax">DB_Action</span><span class="plain-syntax"> </span><span class="identifier-syntax">ac</span><span class="plain-syntax"> </span><span class="identifier-syntax">acr</span><span class="plain-syntax"> </span><span class="identifier-syntax">act</span><span class="plain-syntax"> </span><span class="identifier-syntax">n</span><span class="plain-syntax"> </span><span class="identifier-syntax">s</span><span class="plain-syntax"> </span><span class="identifier-syntax">for_say</span><span class="plain-syntax"> </span><span class="identifier-syntax">t</span><span class="plain-syntax"> </span><span class="identifier-syntax">at</span><span class="plain-syntax"> </span><span class="identifier-syntax">l</span><span class="plain-syntax"> </span><span class="identifier-syntax">j</span><span class="plain-syntax"> </span><span class="identifier-syntax">v</span><span class="plain-syntax"> </span><span class="identifier-syntax">c</span><span class="plain-syntax"> </span><span class="identifier-syntax">clc</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">for_say</span><span class="plain-syntax"> == </span><span class="constant-syntax">0</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">debug_rule_nesting</span><span class="plain-syntax"> &gt; </span><span class="constant-syntax">0</span><span class="plain-syntax">))</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">print</span><span class="plain-syntax"> </span><span class="string-syntax">"("</span><span class="plain-syntax">, </span><span class="identifier-syntax">debug_rule_nesting</span><span class="plain-syntax">, </span><span class="string-syntax">") "</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">ac</span><span class="plain-syntax"> ~= </span><span class="identifier-syntax">player</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">for_say</span><span class="plain-syntax"> ~= </span><span class="constant-syntax">2</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">acr</span><span class="plain-syntax">) </span><span class="reserved-syntax">print</span><span class="plain-syntax"> </span><span class="string-syntax">"asking "</span><span class="plain-syntax">, (</span><span class="identifier-syntax">the</span><span class="plain-syntax">) </span><span class="identifier-syntax">ac</span><span class="plain-syntax">, </span><span class="string-syntax">" to try "</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">print</span><span class="plain-syntax"> (</span><span class="identifier-syntax">the</span><span class="plain-syntax">) </span><span class="identifier-syntax">ac</span><span class="plain-syntax">, </span><span class="string-syntax">" "</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">DB_Action_Details</span><span class="plain-syntax">(</span><span class="identifier-syntax">act</span><span class="plain-syntax">, </span><span class="identifier-syntax">n</span><span class="plain-syntax">, </span><span class="identifier-syntax">s</span><span class="plain-syntax">, </span><span class="identifier-syntax">for_say</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">keep_silent</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">for_say</span><span class="plain-syntax"> == </span><span class="constant-syntax">0</span><span class="plain-syntax">)) </span><span class="reserved-syntax">print</span><span class="plain-syntax"> </span><span class="string-syntax">" - silently"</span><span class="plain-syntax">;</span>
<span class="plain-syntax">];</span>
</pre>
<nav role="progress"><div class="progresscontainer">
    <ul class="progressbar"><li class="progressprev"><a href="ortm.html">&#10094;</a></li><li class="progresssection"><a href="mstm.html">mstm</a></li><li class="progresssection"><a href="sttm.html">sttm</a></li><li class="progresssection"><a href="lgtm.html">lgtm</a></li><li class="progresssection"><a href="lstm.html">lstm</a></li><li class="progresssection"><a href="ortm.html">ortm</a></li><li class="progresscurrent">actm</li><li class="progresssection"><a href="fgtm.html">fgtm</a></li><li class="progresssection"><a href="ottm.html">ottm</a></li><li class="progresssection"><a href="prtm.html">prtm</a></li><li class="progresssection"><a href="wrtm.html">wrtm</a></li><li class="progresssection"><a href="mprtf.html">mprtf</a></li><li class="progresssection"><a href="tmtmp.html">tmtmp</a></li><li class="progresssection"><a href="tstm.html">tstm</a></li><li class="progresssection"><a href="chtm.html">chtm</a></li><li class="progresssection"><a href="strdc.html">strdc</a></li><li class="progressnext"><a href="fgtm.html">&#10095;</a></li></ul></div>
</nav><!-- End of weave -->

		</main>
	</body>
</html>

